|
A code snippet showing how you are writing to the file would be nice. How are you viewing the file once it's been written to?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
hDataFile = CreateFile(
DataFilename,
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
pWin_Data[0] = (PWINDATA)WinBuff_1_Address;
WriteFile(
hDataFile,
pWin_Data[0],
sizeof(ULONG),
ptr,
NULL
);
CloseHandle(
hDataFile);
The File name is with the extension ".dat" and I opened it with notepad.
Deepak Samuel.
|
|
|
|
|
It looks like your code is writing a pointer address to the file. Is this the intention? If you want what the pointer is pointing to, use *(pWin_Data[0])
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
It depends on how you open the file. Do you open it as text or binary? If you open it as binary you would see strange characters because you would be seeing the ascii interpretation of what the numeric values are. For instantce if you output the number 32 as binary it would appear as a space in a text file.
|
|
|
|
|
Hi
How can i get pointer to member function
class A{
virtual bool vfun(){
void* pfun = fun;
}
virtual bool fun(){
void* pvfun = vfun;
}
}
Why this code not compiled.
Thanks.
|
|
|
|
|
real_space_monkey wrote:
Why this code not compiled.
What message is the compiler giving you?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
The error of your code is in the declaration. In the function vfun() , you do not specify a pointer to function, but a pointer to void. Pointers to function have different type of declaration. According to MSDN, a pointer to function receives the following type of specification:
return-value (*variable)(param, ...) So, according to this, the pointers pfun and pvfun should be declared as:
void (*pfun)(void) = pfun;<DIV>
...<DIV>
void (*pvfun)(void) = pvfun;
Now you can call the functions through the pointers by issuing pfun() or pvfun() , as long as you're inside the correct context (inside the function the pointers are declared)
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
Hi,
I would like to know if there is some way
how to chance modeless dialog box into modal.
I mean I already have dialog created
and I just want to show it as modal.
Something like have choice:
dlg.ShowModal(); //is modal
or
dlg.ShowWindow(SW_SHOW); //is modeless
Thanx lot
Viliam
viliam
|
|
|
|
|
You want to change the behaviour while the dialog is visible?
It is probably easier to just close and reopen the dialog programmatically.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
One solution is to derive a class from CDialog and do custom creation. Otherwise, one solution is to overrite OnClose(), etc. and keep the window from losing focus.
Kuphryn
|
|
|
|
|
|
Hi All,
Is there is any get the detail about the network devices like,
Name : HPINKJET
Type : Printer
Sub type : Laser
Make :
Model :
Serial No :
MAC Address:
If anyone of you know, can you please help me.
Thanks.
Regards,
A.Ilamparithi.
|
|
|
|
|
what network device do u mean?
a shared printer, a print server?
Don't try it, just do it!
|
|
|
|
|
Hi Alex...
Thanks for your interest.
By network device, i mean things like router, firewall, printer, etc..
Regards,
A.Ilamparithi
|
|
|
|
|
I execute a console process with the ShellExecuteEx, this process creates a file but it spends 4 o 5 seconds, my next code needs to access this file so I need to wait the end of the execution of my console process or wait 5 seconds until continue the program execution, how can i do that?
thanks
|
|
|
|
|
Add SEE_MASK_NOCLOSEPROCESS to the fMask member of your SHELLEXECUTEINFO structure. The process's handle will be returned in the hProcess member. You can then pass this to WaitForSingleObject , which will return when the process exits. You could also use one of the other XxxWaitForZzz functions.
Don't forget to call CloseHandle on the process handle once the WaitFor function returns.
An alternative is to use CreateProcess rather than ShellExecuteEx .
|
|
|
|
|
Hi ,
I wrote code in MFC , based on ActiveX component Microsoft Internet Explorer.
Purpose of that is to load images by IExplorer.
With JPEG it goes fine , but when I'm trying to load BMP , it runs by default MSPaint (defined by registry) . I'v removed entry from regestry and now any time I want to open a file , IExplorer shows dummy window "Do you want to open / save bla bla bla .. "
How can I avoid this window message ??
Thanx.
Kogi.
|
|
|
|
|
i have created a table in access database. then i tried to retrieve the table using class wizard in the application which was successful. when i am trying to get the methods and properties for this table using pDoc (document class) i am unable to get the methods and properties.
am i missing out something in the whole process????
|
|
|
|
|
Hi,
How do i disable the verticall scroll bar of the CListCtrl,
I want the user only scroll horizontally and not verticaly how do i do that?
Thanx in advance.
Regards,
Prakash
The World is getting smaller and so are the people.
|
|
|
|
|
Mr.Prakash wrote:
How do i disable the verticall scroll bar of the CListCtrl,
Don't add as many items to the control. In other words, if the control can display 9 items and you add 10, a vertical scroll bar will be displayed.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Lol! that is not what i was looking for... Actually i had little idea bout listctrl,I wanted the user to scroll the listctrl horizontally rather than vertically,
I some how figured out that it is done by setting left adjust in the dialog editor.
regards,
Prakash.
|
|
|
|
|
I'm not familar with the "left adjust" style. Could you be more specific?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I need to save some settings to the registry when the user closes my application. For this purpose i use the WM_DESTROY message and it works fine. Now i noticed that the application doesn't receive this message when a user terminates Windows without closing my application before.
How can I detect that the application closes in such a case.
MS
|
|
|
|
|
There are several other ways that Windows destroys it windows. The alternate shutdown is in the WM_COMMAND message when the user clicks on the small *X* or closes from the toolbar. The paramater sent to WM_COMMAND is the IDCANCEL and IDOK default macros. Simply intercept these messages in addition to WM_DESTROY and call the same exit procedures that you have setup for WM_DESTROY. Both IDOK and IDCANCEL are always Windows specific so if you do not program these in then they will call for the Window to destroy without saving any work including freeing memory. IDCANCEL and IDOK, though, is pretty generic so you might want to consider calling the DestroyWindow( HWND ) yourself in addition.
|
|
|
|