|
well, I said may be in stdafx.h, seems you solved now, but then in your previous post you said it didn't work if you include above some other header files.
|
|
|
|
|
|
hai all,
I wrote an application that do some schedule task creation, It works smooth in XP machine, It does not create schedule task in vista,but that i solved by adding the manifest file... My new problem is my application is blocked when it invoked at startup(login or reboot time)...
Pleaser help me if u have any idea ..
Thanks
|
|
|
|
|
After migarating the project to VC9.0, I forgot to initializie for Gdiplus.
====================
CCoolTower::CCoolTower(UINT nIDBmp)
: m_bmp(AfxGetInstanceHandle(),MAKEINTRESOURCEW(nIDBmp))
{
m_rtDev.Width=m_bmp.GetWidth();
m_rtDev.Height=m_bmp.GetHeight();
}
modified on Wednesday, May 21, 2008 4:59 AM
|
|
|
|
|
followait wrote: m_bmp(AfxGetInstanceHandle(),MAKEINTRESOURCEW(nIDBmp))
check why loading of bitmap failed, might not be the constructor issue. move the m_bmp creation statement to normal function (not constructor) and verify why it is failed check the error value. And as a side note, use MAKEINTRESOURCE inplace of MAKEINTRESOURCEW.
|
|
|
|
|
MAKEINTRESOURCE not work, the constructor:
Bitmap(HINSTANCE hInstance,const WCHAR *bitmapName);
In VC6.0 the code;
Bitmap *p=new Bitmap(AfxGetInstanceHandle(),MAKEINTRESOURCEW(nIDBmp));
works fine.
modified on Wednesday, May 21, 2008 3:24 AM
|
|
|
|
|
ok, that's correct, but what about checking the status, Image::GetLastStatus.
|
|
|
|
|
HINSTANCE h=AfxGetInstanceHandle();
m_pBmp=new Bitmap(h,MAKEINTRESOURCEW(nIDBmp));
When debuging into the code, the function below returns NULL:
void * (operator new)(size_t nSize, LPCSTR lpszFileName, int nLine)
{
lpszFileName;
nLine;
return DllExports::GdipAlloc(nSize);
}
|
|
|
|
|
ok, use a temporary variable,
Bitmap bmp(h,MAKEINTRESOURCEW(nIDBmp));
Status gdiSts = bmp.GetLastStatus();
may be GDI+ is not initialized.
|
|
|
|
|
Yes, after migrating, I forgot to initialize GDI+.
|
|
|
|
|
Hi to all
i am using Date Time picker control
at run time i am selecting date and month , and storing this date to somewhere else.
i have one another date & month which is already there in my programme.
then i am comparing both dates , if both dates are not equal then Message Box pops up telling that "stored date & selected dates are not equal "
This is working fine.
But if i select month from the arrow button which is available in calender, then dates are keep on going ,so many message boxs are coming, how can i avoid it ?
or
can i hide that arrow button ?
varun
|
|
|
|
|
what about you compare the date only at DTN_CLOSEUP Notification if you already got DTN_DROPDOWN notification, that is you compare the date only when calender is closed if the calender is opened by the user.
|
|
|
|
|
Hi all,
I want to clean my registry like i want to delete all the items from my registry which are not in use but are occupying spcae. I want to do this through coding....
Can anybody give me any idea to how to do it????
Thanks in advance
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
ThatsMe. wrote: Can anybody give me any idea to how to do it????
By using the registry API. For example, RegDeleteKey() and RegDeleteValue() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think you would better use a ready registry cleaner as TuneUp or RegCleaner.
The biggest problem is not how to delete the key, the problem is how to identify the keys that are not usefull anymore. Good Luck and don't forget to make backups of your registry before trying your code :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
In VC6.0, the header files are like:
#ifndef _HEADER_FILE_H_
#define _HEADER_FILE_H_
#pragma once // sometimes with this line
...
#endif
In VC9.0 it simplified to this:
#pragma once
Did the semantic of #pragma once changed?
|
|
|
|
|
I believe behaviour of "#pragma once" is not changed. I think that code is written to support older compiler also where "#pragma once" is not supported, unsupported pragma directive is ignored by the compiler. And i can find such coding in MFC headers even in VC8, may be it is reused code from earlier version; search files in MFC include directory for "#pragma once", i think you can still find such code in VC9 also.
|
|
|
|
|
as #pragma directives are compiler specific, they may not work with another compiler. Of course, if your only compiler is Visual C++, you don't really have to care about.
but if you wish to be portable, then you have to go with #ifndef stuff...
|
|
|
|
|
Hi,
Hope somebody can help me with this one.
I want to capture pressing "[" and "]" on OnKeyDown() event.
For controls like shift
if(VK_SHIFT)
For capturing letters, I use example pressing s.
if(nChar=="s")
but for other keys like "[", "]" and numerics
it's not applicable.
How can i capture other keys?
|
|
|
|
|
TooShy2Talk wrote: For capturing letters, I use example pressing s.
if(nChar=="s")
you mean if (nChar == 'S') but you should always use Virtual Key codes, because nChar is the virtual key code, capital letter is identified by the Shift/caps key status. you may refer the list of key codes [Virtual-Key Codes ^] to use in your code.
TooShy2Talk wrote: but for other keys like "[", "]" and numerics
for numbers you may use '0'(30) - '9'(39) or VK_NUMPAD(0 - 9) because number can be entered in two different keys num pad and other above characters.
"[" can still be identified by VK_OEM_4 by Virtual-Key Codes but depends on keyboard layout. so it is better to use [VkKeyScan(Ex)^] to convert character to virtual key code and compare,
SHORT iSqrBracketOpen = VkKeyScan(_T('['));
void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == iSqrBracketOpen)
{
MessageBox(_T("Open Square Bracket"));
}
...
}
or use [ToAscii(Ex)^] or ToUnicode(Ex) to convert virtual key code to character and compare.
|
|
|
|
|
Thanks for the reply.
It's a big help
|
|
|
|
|
Hello
I want to make a decoding operation using sample grabber or my custom filter due to a custom encoding algorithm.
If I build a graph like : file source->decoder->file writer , is this approriate for decoder application by means of time ?
Best Regards,
Akin Ocal
|
|
|
|
|
If you know how to write custom filter, the answer to your question is obvious to you.
if the decoder filter is correctly exposed the Media types of the pin, Intelligent Connect of directshow framework can be able to choose the downstream filter not only file writter, can be audio / or video renderer. There is a graphedit tool you can build graph visually and can test.
Akin Ocal wrote: If I build a graph like : file source->decoder->file writer , is this approriate for decoder application by means of time ?
if you want to decode and dump that to a file, it is ok.
|
|
|
|
|
Using Visual C++ 6.0 MFC
I would like to setup a program where the user can use a menu item to display either of two views (say one view displays a square and if the other view is selected a circle is displayed). In addition I would like certain mouse events to cause the view to switch between these same two views. Say a left mouse click causes the square view to be displayed and a right mouse click causes the circle view to be displayed.
What is the best way to set something like this up? I can try to fill in the details, just looking for the best way to set things up initially.
|
|
|
|
|