|
What is EOF defined as? I suspect it may be a function in c++ and a property in c# etc so you would need to call it like a function
while(!xtr->EOF())
If that doesnt work, right click on EOF and select "Go To definition". You should be able to see how its been defined
|
|
|
|
|
Go to definition gives the following:
System.Boolean EOF { get; }
Member of System.Xml.XmlReader
Summary:
When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream.
Return Values:
true if the reader is positioned at the end of the stream; otherwise, false.
So it is definitely a property - like .Name which I used successfully several times. I think it is some sort of compiler/framework bug because even trying to assign a bool variable to xtr->EOF gives a compiler error.
EDIT: I should add that when stepping through the debugger (with while(1) instead of while(!xtr->EOF)) and looking at the properties of xtr, the EOF property IS listed and carries the expected value.
|
|
|
|
|
We just hit this one, it is because of a #define in stdio.h which defines EOF as -1. The easiest quick and dirty fix is to do a #undef EOF before the line in the file if the C library EOF define is not used further on.
|
|
|
|
|
Hello,
If I hve message map functions in the base class then do I need to have message map in the derived class ?
Regards
Prithaa
|
|
|
|
|
No. If the function is already added in the BEGIN_MESSAGE_MAP-END_MESSAGE_MAP of the base class itself then you needn't to add it the derived class unless you want to overide it.
|
|
|
|
|
hai..,
No need ...and not at all required in derived class.
Born to win...
|
|
|
|
|
Hello Friends,
I am trying to change the Desktop Wallpaper programatically. For that I am using IActiveDesktop Interface.But not getting success, I am not getting any compile or run time error but it fails to set the wallpaper.
I am using the following code to get the path of the current Wallpaper and to set the new Wallpaper.
But I am getting only one string each time I call the GetWallpaper(), It is a follow "C:\Documents and Settings\Administrator\My Documents\My Pictures\logo.jpg"
HRESULT hr;
int Count = 0;
IActiveDesktop *pActiveDesktop;
CoInitialize(NULL);
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
WCHAR Wallpaper[MAX_PATH];
wcscpy(Wallpaper,L"c:\\a.bmp");
pActiveDesktop->SetWallpaper(Wallpaper,0);
pActiveDesktop->ApplyChanges(AD_APPLY_ALL | AD_APPLY_FORCE);
pActiveDesktop->GetDesktopItemCount(&Count,0);
pActiveDesktop->GetWallpaper(Wallpaper,MAX_PATH,0);
I also use the SystemParametersInfo API to do the same thing. But the problem is that it only wotks with .bmp file.
If you have any IDEA please tell me. Thnx in advance.
|
|
|
|
|
|
I see the code it same as i am using. And problem still persist.
Is there any way I can use SystemParametersInfo API to set .jpg or .jpeg images as wallpaper or retrive the path of that.
|
|
|
|
|
Pls have a look @ this. This work for me
#include <windows.h>
#include <wininet.h>
#include <shlobj.h>
//Main window procedure WinMain
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iShowCmd)
{
CoInitialize (NULL) ;
HRESULT hr;
IActiveDesktop *pActiveDesktop;
//Create an instance of the Active Desktop
hr = CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IActiveDesktop, (void**)&pActiveDesktop);
//Insert code to call the IActiveDesktop methods
LPCWSTR wcPath = L"C:\\123.jpg" ;
if (pActiveDesktop -> SetWallpaper (wcPath, 0) != S_OK)
{
//The method has failed...
}
pActiveDesktop -> ApplyChanges (AD_APPLY_ALL) ;
// Call the Release method
pActiveDesktop->Release();
CoUninitialize () ;
return 0 ;
}
Ajay
|
|
|
|
|
thnx,
When I check the error code after SetWallpaper it show '0'. that means "The operation completed successfully.". But wallpaper doesn't changed.
I am using like this.
if (pActiveDesktop -> SetWallpaper (Wallpaper, 0) != S_OK)
{
dError = GetLastError();
}
Can you tell me what can be the problem.
|
|
|
|
|
did u call the pActiveDesktop -> ApplyChanges (AD_APPLY_ALL) ; ?
Ajay
|
|
|
|
|
Yes using like this
pActiveDesktop->ApplyChanges(AD_APPLY_ALL | AD_APPLY_FORCE);
But its not working. and even GetWallpaper() show me the same string as I mention above. I tried to find it on google ,but everyone uses the code like me and it works.
|
|
|
|
|
Images that are not BMP (JPG, GIF...) will be converted to a temporary bitmap when you're selecting it from Display Properties, and this feature is functional when Active Desktop is activated.
You can find the temporary bmp file on
<windows drive="">:\Documents and Settings\<user>\Local Settings\Application Data\Microsoft\Wallpaper1.bmp
Ajay
|
|
|
|
|
yup. I know that. but I am using .bmp file right now. And not able to set the .bmp file as the wallpaper.
If I use the Following code to set the wallpaper it works file. But it doesn't work with .jpg or .gif file.
SystemParametersInfo(SPI_SETDESKWALLPAPER,100, Wallpaper, 0);
Is there any way I can use the above code to set .gif or .jpg image as wallpaper.
|
|
|
|
|
Has Active Desktop been enabled?
Your code worked fine for me.
"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
|
|
|
|
|
hi
how to change the color of header of list control. i am new for mfc
thank u
malik
|
|
|
|
|
There are two way to achieve this
1) By Subclassing the Header Control class CHeaderCtrl. This would be the generic way of achiveing the same and further you can reuse this class as well whereever required.
2)You can override the WM_PAINT and WM_CTLCOLOR or WM_DRAWITEM message etc of CHeaderCtrl based on your requirement.
You can get some more knowledge from the Code project link
http://www.codeproject.com/listctrl/skinlist.asp
Ajay kumar, Sr System Analyst
Satyam Computers, Bnaglore
India
ajay.kumar.ind@gmail.com
|
|
|
|
|
Hi,
I have an dialog based application developed on VS 2005 on XP machine.
The main dialogs has a TreeCtrl, buttons etc.
When I exit my application, I get a crash which is inconsistant.
These are the contents of my call stack.
comctl32.dll!5d0a93d0() <br />
[Frames below may be incorrect and/or missing, no symbols loaded for comctl32.dll] <br />
comctl32.dll!5d0a8461() <br />
comctl32.dll!5d0b98ff() <br />
user32.dll!7e41b96b() <br />
comctl32.dll!5d0e9964() <br />
user32.dll!7e4185a4() <br />
user32.dll!7e4188d1() <br />
user32.dll!7e4188da() <br />
comctl32.dll!5d0a9bc6() <br />
mfc80ud.dll!AfxWndProcBase(HWND__ * hWnd=0x001115b6, unsigned int nMsg=515, unsigned int wParam=1, long lParam=5242970) Line 411 + 0x27 bytes C++<br />
user32.dll!7e418734() <br />
user32.dll!7e418816() <br />
user32.dll!7e41c63f() <br />
user32.dll!7e41c665() <br />
mfc80ud.dll!CWnd::DefWindowProcW(unsigned int nMsg=515, unsigned int wParam=1, long lParam=5242970) Line 1029 + 0x20 bytes C++<br />
mfc80ud.dll!CWnd::Default() Line 274 C++<br />
mfc80ud.dll!CWnd::OnLButtonDblClk(unsigned int __formal=1, unsigned int __formal=1) Line 486 + 0xf bytes C++<br />
MYUIuD.dll!1005da21() <br />
MYUIuD.dll!10045542() <br />
mfc80ud.dll!CWnd::OnWndMsg(unsigned int message=515, unsigned int wParam=1, long lParam=5242970, long * pResult=0x0012f3d0) Line 2169 C++<br />
mfc80ud.dll!CWnd::WindowProc(unsigned int message=515, unsigned int wParam=1, long lParam=5242970) Line 1741 + 0x20 bytes C++<br />
MYUIuDuD.dll!1005cc57() <br />
mfc80ud.dll!AfxCallWndProc(CWnd * pWnd=0x013e094c, HWND__ * hWnd=0x001115b6, unsigned int nMsg=515, unsigned int wParam=1, long lParam=5242970) Line 240 + 0x1c bytes C++<br />
mfc80ud.dll!AfxWndProc(HWND__ * hWnd=0x001115b6, unsigned int nMsg=515, unsigned int wParam=1, long lParam=5242970) Line 389 C++<br />
mfc80ud.dll!AfxWndProcBase(HWND__ * hWnd=0x001115b6, unsigned int nMsg=515, unsigned int wParam=1, long lParam=5242970) Line 411 + 0x15 bytes C++<br />
user32.dll!7e418734() <br />
user32.dll!7e418816() <br />
user32.dll!7e41f805() <br />
user32.dll!7e4189cd() <br />
user32.dll!7e431b3c() <br />
user32.dll!7e418a10() <br />
user32.dll!7e42d99d() <br />
mfc80ud.dll!CWnd::IsDialogMessageW(tagMSG * lpMsg=0x001744e8) Line 198 C++<br />
mfc80ud.dll!CWnd::PreTranslateInput(tagMSG * lpMsg=0x001744e8) Line 4268 C++<br />
mfc80ud.dll!CDialog::PreTranslateMessage(tagMSG * pMsg=0x001744e8) Line 80 C++<br />
mfc80ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x000a169c, tagMSG * pMsg=0x001744e8) Line 2882 + 0x14 bytes C++<br />
mfc80ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x001744e8) Line 233 + 0x12 bytes C++<br />
mfc80ud.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x001744e8) Line 773 + 0x9 bytes C++<br />
Sample.exe!CMyApplicationApp::PreTranslateMessage(tagMSG * pMsg=0x001744e8) Line 2052 C++<br />
mfc80ud.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x001744e8) Line 252 + 0x11 bytes C++<br />
mfc80ud.dll!AfxInternalPumpMessage() Line 178 + 0x18 bytes C++<br />
mfc80ud.dll!CWinThread::PumpMessage() Line 896 C++<br />
mfc80ud.dll!AfxPumpMessage() Line 190 + 0xd bytes C++<br />
mfc80ud.dll!CWnd::RunModalLoop(unsigned long dwFlags=4) Line 4322 + 0x5 bytes C++<br />
mfc80ud.dll!CDialog::DoModal() Line 587 + 0xc bytes C++<br />
Sample.exe!CMyApplicationApp::InitInstance() Line 565 + 0x8 bytes C++<br />
mfc80ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020a00, int nCmdShow=1) Line 37 + 0xd bytes C++<br />
Sample.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020a00, int nCmdShow=1) Line 33 C++<br />
Sample.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C<br />
Sample.exe!wWinMainCRTStartup() Line 414 C<br />
kernel32.dll!7c816fd7()
What is causing the crash/access violation.
Could any body guide me in figuring out as to what may be causing the crash??
That would be of great help.
|
|
|
|
|
Can anybody guide me as to what is causing the Access violation in the dll?
|
|
|
|
|
int A[10], *Ptr;
ptr = (int*)malloc(10*sizeof(int));
what is the difference between array 'A' and 'Ptr' with respect to memory?
|
|
|
|
|
Sakthi_Vel wrote: what is the difference between array 'A' and 'Ptr' with respect to memory?
A is allocated in stack where as the memory location pointed by Ptr is allocated in Heap.
|
|
|
|
|
when we come out of the block without calling free(Ptr).
what will happen? Will 'Ptr' memory get released or not?
|
|
|
|
|
It will not be released. That memory will reside there as long as your application is running. Such wastage of memory in a program are called memory leaks.
|
|
|
|
|