|
Which I suspect is just a nice wrapper around that registry key I mentioned. Did you get it to work?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Try this:
#include "uxtheme.h"
#pragma comment(lib, "uxtheme.lib")
...
if(IsThemeActive())
{
}
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hello experts;
how to get the IP address of system using MFC code.
How to use the GetSystemInfo(......); function,
|
|
|
|
|
1/ There may be more than one IP address (in fact, all but guaranteed. eg, 127.0.0.1).
2/ Dig through the archives of this forum for the last two or three weeks. Your question was answered recently.
Iain.
|
|
|
|
|
Hi all,
I want to convert char* to unsigned short* string. How would i accomplish it?? Please give me some hint to make it work.
it would be a great help to me.
Thanks
|
|
|
|
|
Search terms to look for:
USES_CONVERSION
A2T
A2W
MultiByteToWideChar
Iain.
|
|
|
|
|
char *subKey = GetLocalMachineName();
int nSize1 = MultiByteToWideChar(CP_ACP, 0, subKey, -1, NULL, 0);
LPWSTR wSubKey = new WCHAR[nSize1];
MultiByteToWideChar(CP_ACP, 0, subKey, -1, wSubKey, nSize1);
I have used above code. In above code function GetLocalMachineName() returns char * string which works correctly as i have debug it. what is the mistake in above code.. Please help me.
Thanks
|
|
|
|
|
I really suggest you read this article[^]. You will learn everything you need to handle the problem (and even much more).
|
|
|
|
|
Your code works fine for me. Are you sure subKey points to a NULL-terminated string?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you all of you. I also got my solution
However, Thanks a lot
Regards,
Hemang
|
|
|
|
|
Hello,
perhaps somebody can help me to find the reason for the crashes I have.
I have a MFC Application with MFC extension DLLs.
One of the dialogs is a window with a CPropertySheet.
One CPropertyPage is a host for ActiveX Controls providing extending UI.
This CPropertyPage has a CWnd member to host the ActiveX Controls dynamically created runtime using the CWnd::CreateControl method.
I have a VB ActiveX Control providing needed extending UI.
It can be loaded and used without problems.
The only problem occurs, when the application exits:
1. The CPropertySheet is destroyed ... the CPropertyPage is destroyed, ...
... which releases its previously queried interfaces,
... sends a WM_DESTROY to the CWnd hosting the ActiveX Control and
... deletes/frees the CWnd
2. Somewhere at the end just before invoking "exit" open "OLE" connections/loaded "OLE" libraries are terminated by Microsoft internal code. I saw that the ActiveX OCX module was active until this moment.
3. In the "exit" invocation the MFC application crashes from within the VB ActiveX Control. The VB ActiveX Control does not execute its UserControl_Terminate handler, so it seems, that there happens an irregular deletion of the VB ActiveX Control.
This crash happens currently only in the debug version of our application. But adding CommonControls to the VB ActiveX Control UI causes a crash even in the release version of this MFC application.
Using a MFC ActiveX Control providing some UI, too, no problems occur.
The only difference seen while releasing the last reference to the previously queried interface are that ...
... the release on the interface of VB ActiveX Control returns 4 still valid references,
... while the release on the interface of the MFC ActiveX Control returns only 3 still valid references.
Thus I suspect, that at application end there is still a last reference valid, not released, which causes a crash after the OCX is unloaded from Microsoft internal code cleaning up before the real application exit.
Something in the VB ActiveX Control wants still to work (like executing UserControl_Terminate), but the OCX is already unloaded.
But ... where and how can I find this last reference?
Debugging through the MFC code hosting the ActiveX Control didn't help really?
Has somebody here experienced a similar problem? Or can somebody help?
Thanks in advance,
Martin
|
|
|
|
|
Hello again,
first - I'm sorry, because I didn't provide any information about the development environment:
Microsoft Visual Studio 6.0 SP6
Microsoft Visual Basic 6.0 SP6
And ... no ... I can not upgrade - currently!
Second - I created a new most simple MFC application only loading the VB ActiveX control and raising an exception on exiting.
It has a CWnd* member on which CreateControl is called and which is deleted while deleting the dialog object.
So it shows the same behavior than the big MFC application I normally work on.
Has someone a hit or suggestion?
Best regards,
Martin
|
|
|
|
|
Hello,
after trying a bit I changed my VB ActiveX Control to execute the "UserControl_Terminate" things in the "UserControl_Hide" event handler.
Only the call "App.LogEvent ..." stayed in the "UserControl_Terminate" event handler.
And now everything seems to work fine.
Even a VB ActiveX Control with CommonControls (not even touched in the "UserControl_Terminate" event handler) works now.
So - I don't know why, but now everything works.
I found a solution, but no understanding for the problem.
Best regards,
Martin
|
|
|
|
|
I have used some system call in my MFC application to remove some ".txt" file. By my system call i have removed some extra file. I have used some "del" command. That is why some black window come in front of my application. Can i use some VC++ code at place of system call to remove some ".txt" file
|
|
|
|
|
There's DeleteFile()[^] that you can use.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Got my 5 for the wonderful sign
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
[My articles]
|
|
|
|
|
Sign? The signature? Ri..ght?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
yah sir, u r right...plz plz u don't getz angry coz I'm new, plz plz...
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
[My articles]
|
|
|
|
|
If that's the case, all of my posts carry the signature and so you can feel free to 5 vote them.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Looks like THHB in action again..
Regards,
Sandip.
|
|
|
|
|
Yes, BTW you should acknowledge the signature's author giving him, for instance, a new laptop.
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
[My articles]
|
|
|
|
|
Hi all,
I am placing a Bitmap on a DialogBox, when i change the display settings than the dialog box resize according to display settings, and image not.
so i want to resize image too when the dialog box resize.
Please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Like this [^]?
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
[My articles]
|
|
|
|
|
I am using CArray in my application's calculation routine in many places.
When running the calculation its getting slow. How to overcome this?
|
|
|
|
|
how are you using it ?
and how do you mesure the performance impact ?
|
|
|
|