|
i just tried this code..i didnt put any of WM_PAINT or WM_ERASEBKGROUD
but still it works fine
/////////////////////////////////////////////////////////////////////////////
// CTesttestdeleteView drawing
void CTesttestdeleteView::OnDraw(CDC* pDC)
{
TesttestdeleteDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC memDc;
memDc.CreateCompatibleDC(pDC);
memDc.SelectObject(&bitmap);
pDC->BitBlt(10,10,50,50,&memDc,0,0,SRCCOPY);
}
ths workd absolutely fine
|
|
|
|
|
Have a look in onerasebackground as well.
-prakash
|
|
|
|
|
Try using
Invalidate(TRUE);
Ash
|
|
|
|
|
for some reason, that I cannot find why my application crashes when quitting, I can step right through ( spelling please ) CWinApp::ExitInstance and seems to crash just in :
exit(mainret); in WinMainCRTStartup ( which ever the right name is depending on the different defines ) in crt0.c
unfortunatly, VC does not give a call stack or anything that could help.
Anyone using boundschecker 7.2 with VS.net 2003 ?
some of my memory allocation get reported as "Allocation Conflict", allocated by new ( eventually by _malloc_dbg_ in the MS files ) but freed by delete; seems Boundschecker is all mixed up when used with MFC and there are other problems else where.
also, still with boundschecker, in a really simple project ( multi-threaded debug statically linked MFC wizard generated project ) I try to open ( and close ) a simple text file like this :
FILE *myFile;
myFile = ::fopen("tata.txt", "r" );
if (!mdpFile)
{
ASSERT ( 0 );
}
::fclose( myFile );
myFile = NULL;
and it gives a couple of memory leaks related to multithreaded within stream.c ( and mlock.c )
any ideas, hints, suggestions, pressure valves ?
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Well, This is not going to be an answer to you,
Generally If i am quite sure that I have take care of memory leaks, and the leak is somewhere in Core dlls,
I ignore them.
May be Microsoft will post a new patch tht takes care of this mem leak.
-prakash
|
|
|
|
|
I'm trying to interface a DLL parameter with .Net String variable.
How do I convert the .net String type to LPSTR used on DLL parameter ?
Like this:
LPSTR sUser = this->edtUser->ToString();
but this cause the following error :
error C2440: 'initializing' : cannot convert from 'System::String __gc *' to 'LPSTR'
Fernando Oliveira
|
|
|
|
|
|
A quick glance in MSDN shows that the String class has a method called ToCharArray . Have you tried that?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello.
I keep getting the following messages in my output windown when I start my debugger. Do the messages below indicate that I need to install more files. By the way I am using Visual Studio Enterprise Developer:
'OIRP Test.exe': Loaded 'C:\Documents and Settings\user\My Documents\Software Development and Utilization\C Programming\OIRP Test\Debug\OIRP Test.exe', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\mfc71d.dll', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\msvcr71d.dll', Symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\GDI32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\USER32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\SHLWAPI.DLL', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\ADVAPI32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\comctl32.dll', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\OLEAUT32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\OLE32.DLL', Cannot find or open a required DBG file.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\MFC71ENU.DLL', No symbols loaded.
'OIRP Test.exe': Loaded 'C:\WINNT\system32\MSCTF.DLL', No symbols loaded.
The program '[1552] OIRP Test.exe: Native' has exited with code 0 (0x0).
Thanks for any help you can provide.
Thanks for your answers.
|
|
|
|
|
|
Why are these messages not important? I think sometimes I can't run the Debugger or build/compile the program because of these messages - unless I am mistaken.
Any insight that you (or someone else) can provide would be great.
|
|
|
|
|
they are unimportant because everyone gets them every time they start a debugging session. VC is just telling you about the DLLs your program is using. you're not expected to have debugging info for KERNEL32.DLL or any of the other system DLLs.
why do you think you can't debug because of this?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Those are all system DLL's. In order to have debug information for them, you will need to install and debug under a 'checked/debug' version of the operating system. Checked versions are available if you have an MSDN subscription.
Software Zen: delete this;
|
|
|
|
|
I've overrided COleDataSource::OnRenderGlobalData(...) in order to be able to download files that should be returned in this function in the form of CF_HDROP.
The first problem is that I need to wait in this function while the files download so I can provide them in the HGLOBAL. I download using winsock asynchronous sockets so the 'download'-functions return immediately... How do I wait until the download is complete and still be in the function? ( it's in the same thread so I can't just wait? )
Any ideas or comments? I'm quite puzzled over what to do... :\
|
|
|
|
|
i can convert dcm (DICOM) files into jpeg files, but i have no idea how to take into account the windowing/leveling of those dicom files. i don't want to straight up have all the values go through the conversion, i want to display only from a certain range. i know some windowing/leveling algorithms, but applying them to my DICOM files doesn't actually change the data of the dicom file (unless you save them as a DICOM tag) but regardless the image data after the header is constant.
anyone have any ideas?
-raw
|
|
|
|
|
Wrong forum probably, This is VC++ forum, you might want to look for any forum related to DICOM.
-prakash
|
|
|
|
|
I have a class like this:
class C {
private:
char *str;
public:
const char *getStr() { return str;}
};
This protects "str" from getting modified from outside. But thats only a myth, it can actually be modified through casting. For eg, I have been using the following for a while (it is actually very convenient for me, and safe in my application):
PathRemoveFileSpec(const_cast<char *="">(obj.getStr()))
But, I am wondering if there is any way to prevent somebody from doing this. we can perhaps overload the cast operator and make it private, but operator is on the object, not on the "char *" that is returned by getStr().
Any ideas anyone?
|
|
|
|
|
Ok, codeproject has eaten some of my text thinking it is apple. I should have marked it as code. Here it is again:
<br />
PathRemoveFileSpec(const_cast<char*>(obj.getStr()))<br />
|
|
|
|
|
Ah, I am not so good at using codeproject. Perhaps you are good at figuring out what I really wanted to write. Let me try this:
const_cast< char * >
|
|
|
|
|
Flace wrote:
Perhaps you are good at figuring out what I really wanted to write
nop, just wondering why you didn't just edited your post (with the little [Modify] link at the bottom right of a post) instead of posting new ones...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
with the little [Modify] link at the bottom right of a post
-prakash
|
|
|
|
|
As far as I'm aware, you can't overload any of the _cast methods.
Use of const_cast can be tricky to do safely (which is why it's generally preferable to avoid it if you can), but I don't think there's a way to stop someone using it to remove the const'dness (!?) from an object.
It's worth checking out the C++ FAQ Lite[^] for some useful do's and dont's, and it may give you some ideas about how you could protect your class.
|
|
|
|
|
Hello,
I don't have VStudio installed here so I don't know if this works:
#ifdef const_cast
#undef const_cast
#endif // const_cast
#define const_cast \
char* const_cast(const char* psArg) \
{ \
\
}
Note here that you influence the global namespace here and other developers might dislike this "feature". Also remember that using cons_cast to manipulate objects that shouldn't be manipulated is asking for trouble. So it's the responsibility of the developer who is using your class, that he is using it wisely. So don't bother too much to make your class "fool proof" somehow someone will find a way to prove you wrong!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
-- modified at 16:40 Thursday 6th October, 2005
|
|
|
|
|
I want to check an IP against the NAT table mappings . Any ideea how to do this programmaticaly using MF C? A starting point ( or example) will be apreciated !
|
|
|
|
|
When running a console application from a command window which has the quickedit option enabled, a user could inadvertently click in the window text area of the command window, placing it in edit mode. This can suspend a running console application.
Is there a way for the console application to disable/enable quiickedit for the window it's running in? If not, is there another workaround?
-kg
Ken Goguen
|
|
|
|