|
I know of no way to circumvent the HAL in order to get access to such low-level information.
For the fourth bullet, use GetVolumeInformation() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I just saw this article:
Hooking the kernel directly
http://www.codeproject.com/useritems/soviet_direct_hooking.asp
maybe he can help you !
Marcello
|
|
|
|
|
Marcello wrote: maybe he can help you !
I'm not the one needing help, fvalerin was.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes, I meant fvalerin
|
|
|
|
|
is there any way to change the default color(blue) of title bar, and the color of text in a dialog application.
Thanks
|
|
|
|
|
i think only way is to draw them yourself on WM_NCPAINT message.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
|
Hello,
I have a weird error that I hope someone can help me with:
I have a program (SDI), whose view is derived from CPropertyView, a property sheet view by Leo Moll. When I run the application in debug mode, I have no problems whatsoever. However, if I change to release mode, I get the following:
depView.obj : error LNK2001: unresolved external symbol "protected: int __thiscall CDepView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CDepView@@IAEHPAUtagCREATESTRUCTA@@@Z)
Release/dep.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
dep.exe - 2 error(s), 0 warning(s)
In DepView.h, I have:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
In DepView.cpp, I have
BEGIN_MESSAGE_MAP(CDepView, CPropertyView)
ON_WM_CREATE()
...
END_MESSAGE_MAP()
and
int CDepView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
return 0;
}
If I remove either the declaration in the header file, or the implementation (and message map) in the source file, it compiles fine, but crashes when I close it (and of course doesnt initialize anything).
Does this sound familiar to anyone?
I have only seen this error when I forget to include the source file in the project, but I have checked that. What boggles my mind is that it works perfectly in debug mode.
Any help/comments would be greatly appreciated,
Thanks in advanced,
-----------------
Genaro
|
|
|
|
|
Just a guess: I'd check the preprocessor definitions for the release build and compare it to that of the debug build. In particular I'd pay attention to the UNICODE , _UNICODE and _MBCS defines.
Steve
|
|
|
|
|
Hi Stephen,
thanks for the reply. I checked the preprocessor settings, and as far as definitions are concerned, no difference, except for _debug vs. ndebug.
For project options,
Debug is:
/nologo /MDd /W3 /Gm /GX /ZI /Od /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "_DEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/Fp"Debug/dep tool.pch"
/Yu"stdafx.h"
/Fo"Debug/"
/Fd"Debug/"
/FD /GZ /c
Release is:
/nologo /MD /W3 /GX /O2 /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "NDEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/FR"Release/"
/Fp"Release/dep tool.pch"
/Yu"stdafx.h"
/Fo"Release/"
/Fd"Release/"
/FD /c
I can't find anything that would cause the error there... any clues?
-----------------
Genaro
|
|
|
|
|
Looks fine. I can't think of anymore suggestions. Good luck
Steve
|
|
|
|
|
I see at least five differences, which may or may not be the problem. Change the "Relase" values to match the "Debug" values and see if that makes a difference.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thank you for you response,
I just figured it out a while ago. All I had to do was change the first line of the release options to match the debug options, and it worked.
Thanks a lot,
-----------------
Genaro
|
|
|
|
|
I have program that support only DLL, i want to send msg from it to MSMQ,
so what is the best things that i can do ? can i call function in DLL that have Code to send msg for MSMQ ? if not, then what to do ?
Ali
|
|
|
|
|
Hi
I am trying to understand when sender is useful.In what circumstances i need this?
I have a sample code :
<br />
void __fastcall TForm1::Button1Click(TObect *Sender) <br />
{ <br />
TButton *Button = dynamic_cast<TButton *>(Sender); <br />
if (Button) <br />
{ <br />
} <br />
else <br />
{ <br />
} <br />
} <br />
here it writes :
// do something when a call was made
// passing a NULL value for *Sender)
How can it possible?I mean what type of code passing NULL value for *Sender.I am confused.
Please help me to understand the functionality of sender.
Thanks.
|
|
|
|
|
The sender is a pointer to the object that raised the message ( so, it iwll be the button that was clicked ). I can't imagine why it would be called with NULL.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I use bitmap on my dialog.
Also i use CtlColor function to create transparent static text.
The main problem is that my menu still has the same color.
How to create transparent menu for bitmap Dialog?
|
|
|
|
|
no such menu.
but u can draw or use some controls (i.e. static) to simulate "menu bar", when user clicks them, u popup sub-menu by TrackPopupMenu() function.
-- download last software in my signiture to see its performances.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
I have a little problem:
I use ado to connect to a mysql database (version 4.0.12) and mysql odbc driver(3.51).
The system works fine but recently i ran into this problem:
I've installed it on a LAN consisting of 5 win98SE stations making one of them the database server.
The program works on two of them quite ok but fails on the other 3. The thing is that the other 3 computers still connect to the db but some of the querys fail.
Actually is not the querys that fail but rather the call to _RecordsetPtr->GetCollect("field")
To be more precise a query like "SELECT id, name, address FROM clients" works.
A query like "SELECT clients.id AS id, clients.name AS name, ocupations.kind AS kind FROM clients AS clients, ocupations AS ocupations WHERE clients.ocupationid = ocupations.id" fails when i do a call to pRecordSet->GetCollect(L"kind") with invalid pointer.
Another thing to remember is that the database server is installed on one of the computers that do not work. The stations on which the program works connect to this computer via LAN
So, what do i do? Where should i search for the bug? I really have no ideea.
I never had this problem on winxp and this program works on several win88se networks
|
|
|
|
|
It fails only on the Db server machine? If it is so, one thought is, try to change the recordset CursorLocation.
ConPtr->CursorLocation = ADODB::adUseClient
Or
ConPtr->CursorLocation = ADODB::adUseServer
Try both options. This code is applicable only if you are using ADO. I guess you are using ado as _RecordsetPtr->GetCollect() is an ADO smart pointer.
rgds...mil10
|
|
|
|
|
i don't think that this is the problem. The app fails also on some of the clients. I've mentioned that it fails on the server to show that it is not a LAN problem.
Anyways, my XP station connects to that server and runs just fine but even if i set this station to be the server, the win98se one won't work
|
|
|
|
|
I really do not know what caused this problem but installing the latest MDAC from microsoft solved it It's strange but i remember having a problem that crealy pointed to a data access problem. I fixed it then by installing MDAC 2.8 but it didn't work this time. What fixed it was MDAC 2.8 sp1...
|
|
|
|
|
Hey folks, last time I'm posting about this... thing is, no one reads the posts that appear to have answers, even if they are unsatisfactory
My requirements:
1) No MFC
2) No .NET calls (straight-up c++)
3) Read an ASCII file on disk using calls to ReadFile()
4) Store that data read from the file into the c++ string type.
5) Use C++ STL (because I'm already using string manipulation functions from the STL)
6) Call methods that require the use of LPTCSTRs from the WIN32 API (using my c++ STL strings, converting them somehow if necessary)
7) Write back to the ASCII file mentioned in #3 using LPTSTRs using WriteFile().
8) Rinse & repeat.
My questions for you:
1) I'm a c++ / Win32API / STL newbie, so please provide a clear answer any idiot could understand (me :p), with an example if possible.
2) I'm not sure if _UNICODE is enabled, or how that effects my ability to meet my requirements.
3) I've seen the following code, and it seems to me that if I can just fool C++ into accepting that in the string contanier, it will actually store TCHARs, this sounds good. But I really have no idea how to use it:
typedef std::basic_string< TCHAR > tstring;
#ifdef _UNICODE
#define tstring wstring
#else
#define tstring string
#endif
If you need clairifcations, please feel free to post here, or email me at membos AT yahoo DOT com.
|
|
|
|
|
wstring and string classes have a member function called c_str() which return const pointer to c style string.
for example :
string str1 = "some string";
wstring str2 = "some wide string";
const char* c_str1 = str1.c_str();
const wchar_t* c_str2 = str2.c_str();
now LPCTSTR is define as
#ifdef UNICODE
typedef const wchar_t* LPCTSTR;
#else
typedef const char* LPCTSTR;
#endif
so all you need to do is use c++ string or wstring and when you have to call Win32 API function using c_str() to get a pointer to c_style string.
Hope this helps,
-Saurabh
|
|
|
|
|
Hello,
here my problem with socket:
I've got a simple program with a main that calls a dll dynamically.
Example:
int main(int argc, char *argv[])
{
HINSTANCE lib = LoadLibraryA("C:\\mylib.dll");
if (lib == NULL)
printf("LoadLibraryA failed\n");
}
As my dll has a "DllMain" function, it automatically enters in it and it executes code I want to.
My problem is I want to init socket there and whatever I do the "socket" function failed.
My code compile so I've got the good includes and i've attach the Ws2_32.lib in my dll.
Example:
<code>SOCKET m_socket;
WSADATA wsaData;
int res;
res = WSAStartup(MAKEWORD(2,2), &wsaData);
if (res != NO_ERROR)
{
printf("Error : WSAStartup() [%ld]\n", WSAGetLastError());
return 1;
}
m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (m_socket == INVALID_SOCKET)
{
printf("Error : socket() [%ld]\n", WSAGetLastError());
WSACleanup();
return 1;
}
...</code>
Socket function always failed with this error code: 10091 that is in MSDN: WSASYSNOTREADY
In MSDN it is said that this error is returned by WSAStartup. However for me it is the socket function.
If I translate my socket code directly in my main program, it works pretty well. As a consequence, are there some trouble to deal with socket in a dll called dynamically?
Thanks for your help.
-- modified at 14:32 Monday 17th April, 2006
|
|
|
|