|
I've tested and checked it again... none of the controls has the GROUP attribute. And none of the static controls has the TABSTOP, all the other controls has the TABSTOP attribute.
|
|
|
|
|
I need to Send XML data to s target server over SSL but the target server requires me to use a PKCS#12 certificate which they have issued to me. However, the PKCS#12 file's password is an MD5 hash of a plaintext password. I can read the PKCS#12 file via code having encrypted the password ok, but I am having problems installing the certificate into the LOCAL_STORE as MMC will not install a PKCS#12 file with a MD5 hash as the password.
My question is: is it possible to use a PKCS#12 cert file from disk rather than from the LOCAL_STORE? If so how, as the setOption method of the IServerXMLHTTPRequest2 object requires the 2nd arg to be a LOCAL_STORE\... entry????
Any advice on this would be very welcome as it is begining to get me down!
|
|
|
|
|
How Can I open a Microsoft Word document in C++? I don't want to open it as text or RTF format. How can I open it in its word doc format? thanks in advance for your help.
|
|
|
|
|
Use ShellExecute() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello,
Hope it is not a stupid question but suppose I have an int i = 20031225 and I would like to parse it to get the 4 first figures (2003) and the last 2 figures (25), like the functions CStringT::Left and CStringT::Right.
is it possible to do it without too much coding and without converting into string?
Thnks.
|
|
|
|
|
Arris7 wrote: I would like to parse it to get the 4 first figures (2003)...
Divide by 10000.
Why are you against using an intermediary string?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dividing by 10000 is a very good idea.
And to get the latest 2 figures by doing i%100 works fine also.
Actually I use a huge amount of data and it takes too much time to process.
I also would like to get any numbers from the figure. for example I would like to extract 01 from 20030112. Is it doable?
|
|
|
|
|
Of course, you can do:
extraction = (i / 100) % 100;
but, as already stated by DavidCrow, this is better done using strings.
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.
|
|
|
|
|
CPallini wrote: but, as already stated by DavidCrow, this is better done using strings.
I never said one way was any better than the other. I was simply asking why he was adamantly against the string solution. It would take quite a bit of empirical testing to find which of the two methods was the "better" one. One might be faster, but the other could be more intuitive.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, I oversimplified. Using strings makes code more clear.
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.
|
|
|
|
|
thanks for the solution.
but why using string is better?
In my case I use a huge volume of data of int type and my data is fixed length.
data extracted with the solutions you provided me will be used for calculations. So converting to string + parsing data + reconverting again to int will probably be expensive in term of execution speed.
|
|
|
|
|
Arris7 wrote: So converting to string + parsing data + reconverting again to int will probably be expensive in term of execution speed
I don't know. Maybe it depends on what you are exactly doing...
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.
|
|
|
|
|
I am using CMyBclass(for eg) derived from CButton Class from MFC and using DrawItem method for drawing own child controls.Except radiobuttons everthing is perfect till the time....but the thing is i am getting the controls drawn on a window perfectly....now i am getting the problem in handling that....i.e.I need to handle the radio button events ....CHECKED and UNCHECKED.....
....for that i need a Handle of Parent window...
I have options of GetParent() method...I am using like this....
CWnd *p =GetParent(); from where i am getting the handle of that....i want the functionality of radiobuttons to be in my derived class so i am doingn that....
Can Any one find the solution of controlling the radio button in derived class so that event handling can be done in that only....
This is what i am trying to get that handle//....
CWnd *pChild = NULL;
for (pChild=GetWindow(GW_CHILD); pChild; pChild=GetWindow(GW_HWNDNEXT))
{
if (pChild == pBtn)
{
((CRadioButtonEx *)pChild)->SetCheckStatus(false);
((CRadioButtonEx *)pChild)->Invalidate(TRUE);
}
}
Basically m derived class should able to handle the Events associated with the radio buttons....
Can any one know the solution....
Shailesh
|
|
|
|
|
Here is my code:
<br />
#define WINVER 0x0500<br />
#include <windows.h><br />
<br />
#define WM_MOUSEHOVER 0x02A1<br />
#define WM_NCMOUSEHOVER 0x02A0<br />
<br />
<br />
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);<br />
<br />
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpszCmdLine,int nCmdShow)<br />
{<br />
HWND hwnd; <br />
MSG msg; <br />
WNDCLASS wndclass; <br />
TCHAR* szAppName = TEXT("MOUSEHOVER"); <br />
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); <br />
wndclass.hCursor = LoadCursor(NULL,IDC_ARROW); <br />
wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION); <br />
wndclass.lpszClassName = szAppName; <br />
wndclass.cbClsExtra = 0; <br />
wndclass.cbWndExtra = 0; <br />
<br />
wndclass.lpszMenuName = NULL; <br />
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS ;<br />
wndclass.lpfnWndProc = WndProc; <br />
wndclass.hInstance = hInstance; <br />
<br />
if( !RegisterClass(&wndclass) ) <br />
return 0;<br />
hwnd = CreateWindow( <br />
szAppName, <br />
szAppName, <br />
WS_OVERLAPPEDWINDOW, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
CW_USEDEFAULT, <br />
NULL, <br />
NULL, <br />
hInstance, <br />
NULL <br />
);<br />
ShowWindow( hwnd,nCmdShow );<br />
UpdateWindow( hwnd );<br />
while( GetMessage(&msg,NULL,0,0) )<br />
{<br />
TranslateMessage(&msg); <br />
DispatchMessage(&msg);<br />
} <br />
return msg.wParam;<br />
}<br />
<br />
LRESULT CALLBACK MouseProc( int nCode, WPARAM wParam, LPARAM lParam )<br />
{<br />
switch( wParam )<br />
{<br />
case WM_MOUSEHOVER:<br />
MessageBox( ((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("mousehover hooked"), TEXT("mousehover"), MB_OK);<br />
break;<br />
case WM_NCMOUSEHOVER:<br />
MessageBox( ((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("ncmousehover hooked"), TEXT("ncmousehover"), MB_OK);<br />
case WM_LBUTTONDOWN:<br />
MessageBox(((PMOUSEHOOKSTRUCT)lParam)->hwnd, TEXT("lbuttondown hooked"), TEXT("lbuttondown"), MB_OK);<br />
break;<br />
}<br />
return CallNextHookEx(NULL, nCode, wParam, lParam);<br />
}<br />
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )<br />
{<br />
switch( message )<br />
{<br />
case WM_CREATE:<br />
{ <br />
SetWindowsHookEx(WH_MOUSE,MouseProc,<br />
((LPCREATESTRUCT)lParam)->hInstance,<br />
GetCurrentThreadId());<br />
return 0;<br />
}<br />
case WM_MOUSEMOVE:<br />
{<br />
TRACKMOUSEEVENT tme;<br />
tme.cbSize = sizeof(tme);<br />
tme.dwFlags = TME_HOVER;<br />
tme.dwHoverTime = 500;<br />
tme.hwndTrack = hwnd;<br />
<br />
TrackMouseEvent(&tme);<br />
<br />
return 0;<br />
}<br />
case WM_MOUSEHOVER:<br />
MessageBox(hwnd, TEXT("mousehover"), TEXT("mouseHover"), MB_OK);<br />
return 0;<br />
case WM_NCMOUSEHOVER:<br />
MessageBox(hwnd,TEXT("ncmouseHover"), TEXT("ncMouseHover"), MB_OK);<br />
return 0;<br />
case WM_LBUTTONDOWN:<br />
MessageBox(hwnd,TEXT("lbuttondown"), TEXT("lbuttondown"), MB_OK);<br />
return 0;<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
}<br />
return DefWindowProc( hwnd, message, wParam, lParam );<br />
}<br />
When the cursor hovers over the window for a period of time, only the message box with the content being "mousehover" pops up ,while the one called in the MouseProc does not.But WM_LBUTTONDOWN is hooked successfully.
Can any one explain why and tell me how to hook WM_MOUSEHOVER and WM_NCMOUSEHOVER?
Besides,when I use TME_HOVER and TME_NONCLIENT together, no message box pops up at all except those due to mouse clicks. Is it because WM_NCMOUSEMOVE is generated instead of WM_MOUSEMOVE,which leads to the failure of call to TrackMouseEvent? How can I use TME_HOVER and TME_NONCLIENT together?
Thank you
-- modified at 3:30 Tuesday 1st May, 2007
|
|
|
|
|
Please try to hook WH_GETMESSAGE.
Because WM_MOUSEHOVE is post to the message quene.
|
|
|
|
|
i am downloading a file from url. while downloading there is a firewall access that ask for grant access. when this comes my screen will be white (seems to be hanged but downloading is going on.) how to avoid the screen becoming white
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Put your code for downloading the file in a separate thread.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
i think u can do something like this
>create a separate thread for downloading a file.
>may be u need a worker thread.
check this out
http://www.developerfusion.co.uk/show/1715/
|
|
|
|
|
hmm ok but i have to install the package once downloaded. when i use threading both installtion and downloading start together. how to avoid this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Your installation code needs to wait for the download thread to complete. See this[^] article for instructions on how to do this.
/ravi
|
|
|
|
|
|
Hi ,
Am working on EVC , i need to get some information of my device like
device name , device id,platform, net connection status ,power source,volume level through some WINCE API . i dont know which site to refer for the api names , please help me out in this .
Thanks in advance
|
|
|
|
|
Hello!
I have a major problem with my MFC-application:
My software (MFC, VS2005) experiences since some minor changes some weird crashes. The stragest thing is, that most crashes are
connected to one class, that keeps my configuration. But i don´t see anything, that might cause memory-leak or things like this.
Here is what happens:
- When assigning a config-object to another the programm crashes with "lock"
I did a workaroung for this by transfering this object by reference, so there is only the "master-copy" of the object, that is only linked to the other objects using the data inside this object.
- "Visual Leak Detector" delivers no memory-leak, but of course only if the app doesn´t crash
- when accessing an funtion from an DLL (C-Code) i get a access-violation
- an older (befor the changes) version is running perfectly
- when compiling as "release" i get different crashes than with "debug"
- when copying int-values from the config-object to an int i get 2^16-times the value (16bit left-shift of the value), e.g. 122 (1111010) becomes 7995392 (1111010 00000000 00000000)
What i guess is, that there´s something wrong with memory-management inside my app. But i have no idea where it could be!
Does anyone have any ideas how to find this problem?
Thanks a lot for helping!
J.
|
|
|
|
|
The first thing I would check is the arrays (such as char[]) (if you use arrays) for overflow.
In my experience, a one byte overflow in an array doesn't cause runtime errors, but can lead to the problems you are describing.
I don't know how experienced you are, but remeber that the 'real' length of a char array is the length och the characters plus one (the terminating '\0'-byte).
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|