|
u got any corrections plz correct me cos am new to posting
i tried using the debugger but the messages are printed after the main returns 0
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
How about adding breakpoints inside the functions, and see what the callstack looks like when they get called
|
|
|
|
|
This is probably one of the wurst ways to call a function on exit of another function.
To see what happens one should know a little/lot about the way c/c++ works and look at the assembly code.
Simply said: the programmer (prob a hacker who deserves to be shot ) is overwriting the return address of the function. So when the function exit it returns to the newly linked function instead.
codito ergo sum
|
|
|
|
|
BadKarma wrote: This is probably one of the wurst ways to call a function on exit of another function.
Unless you take job security into consideration.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
Unless you take job security into consideration.
In that case this guy deserves a medal.
codito ergo sum
|
|
|
|
|
Hi !
All , I want to add file image icon with my file name when i add the type of file in the listview .
can any have idea about adding the image in the listview???
Amit
|
|
|
|
|
amitmistry_petlad wrote: I want to add file image icon with my file name when i add the type of file in the listview .
Use SHGetFileInfo .
SHFILEINFO shfi = { 0 };
SHGetFileInfo( _T( "your_bmp_file_name.bmp" ),
FILE_ATTRIBUTE_NORMAL,
&shfi, sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES ); This code retrieves icon associated with bmp file type.
|
|
|
|
|
Thanks !
but how can I add the icon in the listview. Look at the source code.
LvItem.iItem=0;
LvItem.iSubItem=0;
HIMAGELIST llistaImatgesG=ImageList_Create(GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON),ILC_COLOR32|ILC_MASK,1,1);
HICON hIcona=LoadIcon(hInst,MAKEINTRESOURCE(IDI_QUESTION));
<code>
SHFILEINFO shfi = { 0 };
SHGetFileInfo( _T( "quest.bmp" ),FILE_ATTRIBUTE_NORMAL,&shfi, sizeof(shfi),SHGFI_ICON|SHGFI_USEFILEATTRIBUTES );
</code>
|
|
|
|
|
amitmistry_petlad wrote: but how can I add the icon in the listview
SHFILEINFO has an hIcon member that holds the icon of the corresponding file type. You can use that icon.
|
|
|
|
|
Hi all.
result of this code is "cant create File" and I dont know why.
can help??
<br />
wchar_t FileName[250]= L"C:\\File Manager Service Log\\log.txt";<br />
wchar_t *pFileName = MySystemTime(FileName);<br />
HANDLE F;<br />
<br />
F=CreateFile((LPCTSTR)pFileName,<br />
GENERIC_READ, <br />
FILE_SHARE_READ,<br />
NULL,<br />
CREATE_NEW,<br />
FILE_ATTRIBUTE_NORMAL,<br />
0);<br />
<br />
<br />
<br />
if(F == INVALID_HANDLE_VALUE)<br />
{<br />
printf("cant create File");<br />
<br />
getchar();<br />
return;<br />
}<br />
|
|
|
|
|
david bagaturia wrote: wchar_t *pFileName = MySystemTime(FileName);
HANDLE F;
Does pFileName conatins valid path here ? If yes, then there should not be any problem with file creation.Use GetLastError to narrow down the error.
|
|
|
|
|
try calling GetShortPathName before the create file function..
|
|
|
|
|
What happens if you run this code
wchar_t FileName[250]= L"e:\\Test is ok\\log.txt";
HANDLE F;
F=CreateFileW(FileName,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_NORMAL,
0);
CloseHandle(F);
|
|
|
|
|
using the function AcceptSecurityContext for authentication. But the fn returns error when trying to authenticate on a virtual machine.
SEC_E_NO_AUTHENTICATING_AUTHORITY
No authority could be contacted for authentication. This could be due to the domain name of the authenticating party being wrong, the domain being unreachable, or to a trust relationship failure.
in case of virtual machines, is there one more level involved?
thanks
|
|
|
|
|
Hello, I would like to click the "OK" button of the window programmatically.
How can I do this if I know the ID of window and button.
Thanks & Regards,
Suman
-- modified at 3:07 Monday 19th February, 2007
|
|
|
|
|
Use WM_COMMAND .
SendMessage(hWnd,WM_COMMAND,(LPARAM)IDOK,0);
|
|
|
|
|
Hi prasad_som, where would one find a very good example of the SendMessage function, Explaining all of the commands that can be used and so on. I have looked on MSDN but the example they give is a bit crappy ...
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Hi prasad_som, where would one find a very good example of the SendMessage function, Explaining all of the commands that can be used and so on
SendMessage is very generic function, can be used with all window messages.
It includes command messages.
So, you can see in documentation of messages(WM_SETTEXT etc.), how it can be used with SendMessage , how to send extra information etc.
Or something else you was looking for ?
|
|
|
|
|
No thank you, I'll dig around and see what I can find. But thnk you very much for the help and steering me into the right direction.
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Welcome !
|
|
|
|
|
Its easy it has four parameters SendMessage(Handle to window,Specifies message,WPARAM,LPARAM);.;)
Like this:
SendMessage(hWnd,WM_CLOSE,0,0);
|
|
|
|
|
See this[^] thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks a lot for great help from you both!!
Best Regards,
Suman
|
|
|
|
|
Hi,
I have created MSI package using VS 2005, but whenever i install the msi package it is asking for me where to install, but i want it to ask only at the first installation, if am installing second time it should not ask me, it should go to default folder which i have selected previously
Manjunath S
GESL
Bangalore
|
|
|
|
|
Hi,
I need to change the color of the CStatic text. How can i do that ?
Thanks
Bye
|
|
|
|