|
Now I can replace icon resource in a .exe file from other .exe file.
I copy code from MSDN about UpdateResource.
But I can not update icon resource from a icon file.
|
|
|
|
|
In almost the same way. When copying from one EXE to another, you used LoadImage() /LoadResource() followed by LockResource() to get a pointer to the icon's data. You then called UpdateResource() with that pointer. When using an ICO file, the only difference is to use CreateFile() to open the ICO file, followed by ReadFile() to get a pointer to pass to UpdateResource() . Make sense?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hello!
How to get handler to window, when i have its ID and its name?
|
|
|
|
|
HWND hWnd = ::FindWindow(NULL, "Window name");
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Using MSDN documentation I can do it with functions SetFileSecurity or SetNamedSecurityInfo but for the folder these permissions do not visible in 'securyty' property sheet of IE(right mouse click on folder->properties). Inspite of this they work fine. How to make them visible there ?
I found VBasic example HOWTO: Set Security on a NTFS Folder Programmatically.
There they set permissions 'for the folder' and for the files... Some one face such a problem.
Appreciate any information.
|
|
|
|
|
Just as the suject.
Rap off for you,for me,for our human.
|
|
|
|
|
Blade
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
|
Hi,
I've made a dll for use within a PowerBuilder application. When I compile this dll under Windows Xp it runs well under Windows Xp and Windows 2000. On Windows NT however, it crashes. The problem is due to the fact that, when compiled under Xp the size of the MENUITEMSTRUCT I use is set to 48 while it's 44 on NT. How can I change the coding so it runs on both Xp and NT.
This is the code I use for setting the size:
MENUITEMINFO info
info.cbSize = sizeof MENUITEMINFO;
Thanks in advance,
Aart
|
|
|
|
|
As long as _WIN32_WINNT is defined to be less than 0x0500, you should be all right.
The hbmpItem member should only be included if _WIN32_WINNT is greater than or equal to 0x0500 (i.e. if you're targetting Windows 2000 or later).
|
|
|
|
|
Im writing a program that searches an ActiveDirectory database and want the program to take a search argument like "moderator" through a dialog window and the program will search for everyone that is a moderator.
So my search function takes a CString as a parameter
But to use it in the search it must be a LPWSTR (pszSearchFilter).
HRESULT ExecuteSearch(LPWSTR pszSearchFilter, LPWSTR* pAttributeNames, DWORD dwNumberAttributes, PADS_SEARCH_HANDLE phSearchHandle);
I havetried to builda CString that looks like this:
L"(&(objectClass=user)(title=moderator))";
And then it must be converted to LPWSTR or CComBSTR or whatever that works ... any ideas how ?
Thanks in advance !
|
|
|
|
|
Try converting the CString into a _bstr_t
CString searchParameter("the search string");
_bstr_t bstr(searchParameter);
Mike
|
|
|
|
|
You should be able to do it like this...
CString str("Hack on!");
BSTR bstr = str.AllocSysString();
CComBSTR bstrTemp;
bstrTemp.Attach(bstr); Hack on...
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Thanks guys, got it to work thanks to your tips !
|
|
|
|
|
I have a application developed in MDI.
The strange thing is that it will cause my system utilizing 100% of the CPU usage.
I have checked the OnIdle(), OnTimer and OnUpdateCommandUI but it is not the cause of the problem
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
You will need to trim the code down to the minimum required to reproduce the problem. Or, you can create a new MDI application and add code to it until the problem appears.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Please help me. i am a MFC beginner , and i don't know how to combine two numbers in a dialog box. for example: when a and b are entered into Box1 and Box2, In Box3 will show "ab", NOT "a+b" . Please........HELP.
|
|
|
|
|
using CString + operator
Eg.
CString str = atoi(YourInteger);
str += "2";
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
using CString + operator
Eg.
CString str = atoi(YourInteger);
str += "2";
Could u explain more on these?
I am not able to follow it.
|
|
|
|
|
hey, guy, try this...
...
char szA[100], szB[100], szC[200];
int c;
printf(szA,"%d",a); //here, a is a int number entered on edit box 1.
printf(szB,"%d",b); //here, b is a int number entered on edit box 2.
strcpy(szC,szA);
strcat(szC,szB);
c = atoi(szC); //here, c is the int number you want, just place it into edit box 3
...
hope this helps!
|
|
|
|
|
char szA[100], szB[100], szC[200];
int c;
printf(szA,"%d",a); //here, a is a int number entered on edit box 1.
printf(szB,"%d",b); //here, b is a int number entered on edit box 2.
strcpy(szC,szA);
strcat(szC,szB);
c = atoi(szC); //here, c is the int number you want, just place it into edit box 3
This doesn't work for me.
What is char szA[100], szB[100], szC[200];?
Should I use Cstring for BOX3?
|
|
|
|
|
How "it doesn't work for you"? what error occurred?
szA,szB,szC just are temporary char string variables.
|
|
|
|
|
No error occurred, but nothing appear in box3
|
|
|
|
|
oh, god...
just attach a CString class variable with your edit box 3, and then make it equal to "szC", and then call UpdateData(FALSE) to make it show in edit box 3...
|
|
|
|
|
and, you can also...
attach a int variable with your edit box 3, and then make it equal to c, and then call UpdateData(FALSE) to make it show in edit box 3...
|
|
|
|