|
Hi,
Is there any API exists to convert windows messages such as "WM_CLOSE" into its integer value.
I means when I provide "WM_CLOSE" as a string it should then convert it into its integer value.
Thanks,
Mushq
|
|
|
|
|
Nope, AFAIK. Why do you need it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Why do you need it?
For Readability purpose
Actually I have got dialog based application that contains an edit box for writing "Windows Message”, so that user should provide "WM_CLOSE" as an input to that edit box instead of its integer value.
Regards,
Mushq
|
|
|
|
|
I think you may build a map with the info extracted from the Windows headers.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Why don't you instead populate a list with the different messages the user can send to the window ? This way you can associate yourself the message text ("WM_CLOSE") with its value. And it is more secure in the sense that the user can only enter valid messages.
|
|
|
|
|
HI all experts,
Win32_SerialPort
Win32_SerialPortConfiguration
Win32_SerialPortSetting
I want to use these APIs to get detail information
about ports.but i m fail to use them in correct way.
plz anyone can send me the Sample source code
or procedure of how to use and get my aim.
I also visit the MSDN for more info.. but still confused.
Please Help me..
I m waiting..
THnaks in Advance.....
|
|
|
|
|
Well, I think MSDN [^] is the best resource for.
What does make you confused?
BTW CP [^] is another good resource.
Sorry, it seems I missed the target.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
modified on Wednesday, April 30, 2008 10:05 AM
|
|
|
|
|
Somesome modified your post .
|
|
|
|
|
It was my double personality, I think. No, wait, I'm not thinking that. Actually, maybe I was just thinking that...
That..., what?
Remember: CPallini abuz...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Man, you are crazy but cool
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Here's one of my excerpts:
hr = pService->CreateInstanceEnum(_bstr_t("Win32_SerialPortConfiguration"), WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum);
if (WBEM_S_NO_ERROR == hr)
{
hr = pEnum->Next(WBEM_INFINITE, 1, &pClass, &ulReturned);
if (WBEM_S_NO_ERROR == hr)
{
hr = pClass->Get(L"Description", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("Description = %S\n", V_BSTR(&v));
hr = pClass->Get(L"BaudRate", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("BaudRate = %u\n", V_UINT(&v));
hr = pClass->Get(L"BitsPerByte", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("BitsPerByte = %u\n", V_UINT(&v));
hr = pClass->Get(L"Parity", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("Parity = %S\n", V_BSTR(&v));
hr = pClass->Get(L"StopBits", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("StopBits = %S\n", V_BSTR(&v));
pClass->Release()
}
pEnum->Release();
}
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Helo,
I m writing static library win32 static library . I m uisng third party tool dll API .
tell me how I add dll file into my static lib(win32 static lib)
I m using visual c++ 6.0
Regard,
Amit
|
|
|
|
|
I used once a third party dll inside another self-programmed dll.
The third party dll had a *.lib and a *.h files. I included the *.lib into the main Application and the header in MyDll.cpp
If the third party dll has no lib, then I think you should include the header in your cpp and load the dll dinamically into your own dll before using it.
After just include your own lib and header in the main application.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
My project has two modules, one is mfc exe, the other one is a mfc regular dll.
Now I'd like to get the CWinApp* pointer of the exe in a exported function of the dll.
Can I use some kind of AfxGet...App/Module() to do that?
|
|
|
|
|
Hi,
U can use AfxGetApp to get a pointer to the Main application
thanks,
Nitheesh
|
|
|
|
|
Hi,
How to track the key "windows+d" preseed in my application?
|
|
|
|
|
What about a keyboard hook?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
I cant well dont no how to connect to a Mysql database using c++ because im making a program where i can alter peoples prefrences in a program. also can you tell me how to run queries.
db url: localhost;
db user: admin_root
db pass: **********
db db: logon
thanks
|
|
|
|
|
Have you heard about ADODb, OleDB, ODBC? If not then try to figure out what do you want to use and why. After finding a solution to this you can go and drill down to the basics and intricacies of the method you choose to use.
I now know what your database password is
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
1) ->[^]2)->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Although it is a bit more than you need, here is an example.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I sow the sample there is in this site how to add menu to the IE and actually done something quit similar in the pars, its was good for the IE6 but doesn't looks good on the IE7
Is there a way to add a 'real' drop down menu to an IE Toolbar button that will look like the original buttons that come with the IE7.
|
|
|
|
|
Hi EveryOne,
In ActivexDLL I have written a method called Connect(..)inside a class. The method exposes the functionality of connecting to another system using sockets.
The problem here is when I compile my project I am getting link errors(unresolved external symbol). These errors are thrown when winsocks methods are called like htos(),inet_addr(),connect() are called.
Unresolved symbol (upto my knowledge) are thrown when the function definition is unknown or its different from the one that is implemented. since I am using an inbuild function (used the header file winsock2.h) what might be the cause to the problem? How would I Overcome it. Please find the code below.
STDMETHODIMP CRAPClientX::Connect(BSTR serverIP, BSTR serverPort,BSTR *output)<br />
{<br />
<br />
<br />
WSADATA wsaData;<br />
char returnString[150];<br />
<br />
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);<br />
if (iResult != NO_ERROR)<br />
printf("Error at WSAStartup()\n");<br />
<br />
<br />
SOCKET ConnectSocket;<br />
<br />
ConnectSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);<br />
<br />
if (ConnectSocket == INVALID_SOCKET) <br />
{<br />
sprintf(returnString,"Error at socket(): %ld\n", WSAGetLastError()); <br />
*output=SysAllocString(_bstr_t(returnString)); <br />
WSACleanup();<br />
return S_OK;<br />
}<br />
<br />
<br />
sockaddr_in clientService; <br />
<br />
clientService.sin_family = AF_INET;<br />
<br />
clientService.sin_addr.s_addr = inet_addr("127.0.0.1" );<br />
<br />
clientService.sin_port = htons( 27015 );<br />
<br />
<br />
if ( connect(ConnectSocket, (SOCKADDR*) &clientService, sizeof(clientService) ) == SOCKET_ERROR) <br />
{<br />
sprintf( returnString,"Failed to connect.\n" );<br />
*output=SysAllocString(_bstr_t(returnString));<br />
WSACleanup();<br />
return S_OK;<br />
}<br />
<br />
sprintf(returnString,"Connected to server.\n");<br />
*output=SysAllocString(_bstr_t(returnString)); <br />
WSACleanup();<br />
return S_OK;<br />
}<br />
kinldy reply.
Regards,
LG.
lgatcodeproject
|
|
|
|
|