|
Hello
Thanks for quick response.
Before posting here I have tried SetBitmap() or SendMessage() Functions. In the link you mentioned it is once again telling the same.
Use SetBitmap(). So this wont solves my problem
Thanks.
|
|
|
|
|
I was simply responding to your "SetBitmap is not available for CButton" statement.
Have you looked at the CImage class? It can handle other graphic formats in addition to BMP.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi...
Is this is correct way of using CImage & its functions?
Because using this also I was not able to load image.
HBITMAP hBitmap = NULL;
hBitmap = SHLoadImageFile(TEXT("windows\\dlrbtn_up_land.gif"));
CRect tr;
m_btnSeven.GetClientRect(&tr);
HDC hdc;
hdc = ::GetDC(m_hWnd);
CImage cImage;
cImage.Attach(hBitmap);
cImage.Draw(hdc,tr);
|
|
|
|
|
Hello ....
Pls can somebody help me regarding this.
Thanks
|
|
|
|
|
Hi all,
i am trying to make registry enteries of type REG_DWORD. for that i m passing a integer value 1 but in registry its giving invalid dword 32 bit value...
how can i make correct registry enteries
Thanks in advance
|
|
|
|
|
Can you post relevant code??
Regards,
Sandip.
|
|
|
|
|
setregvalue1(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\test"),_T("NoModify"),0x00000001);
void setregvalue1 ( HKEY hkey, CString str_hkey, CString name, CString data)
{
HKEY childkey = 0 ;
DWORD dispos ;
RegCreateKeyEx ( hkey, (LPCTSTR) str_hkey, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_CREATE_SUB_KEY | KEY_ALL_ACCESS, NULL, &childkey, &dispos ) ;
RegSetValueEx ( childkey, (LPCTSTR)name, 0, REG_DWORD, (const BYTE*) (LPCTSTR)data, data.GetLength());
RegCloseKey ( childkey ) ;
}
|
|
|
|
|
VCProgrammer wrote:
RegSetValueEx ( childkey, (LPCTSTR)name, 0, REG_DWORD, (const BYTE*) (LPCTSTR)data, data.GetLength());
Are you passing the CString for type REG_DWORD.
I think it should be
DWORD dwValue;
RegSetValueEx ( childkey, (LPCTSTR)name, 0, REG_DWORD, (const BYTE*) &dwValue, sizeof(DWORD));
check this for information Registry Operations[^]
Regards,
Sandip.
|
|
|
|
|
thanks it solved my problem
|
|
|
|
|
VCProgrammer wrote: RegSetValueEx ( childkey, (LPCTSTR)name, 0, REG_DWORD, (const BYTE*) (LPCTSTR)data, data.GetLength());
You've told RegSetValueEx() to expect a DWORD value, yet what you are passing is not. Try:
char *stop;
DWORD dwValue = strtoul(data, &stop, 10);
RegSetValueEx(childkey, name, 0, REG_DWORD, (const BYTE *) &dwValue, sizeof(DWORD));
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I think this[^] article is helpful for you.
|
|
|
|
|
Hi
In my apllication vc++ 6.0 i have 2 thread’s running ThraedA and ThreadB.
In ThreadB some process is keep going.
In ThreadA ,there is a button on clicking, it should send a message to ThreadB(which is busy on doing some other task).
Now my query is this, when ThreadA send a message to ThreadB ,ThreadB should immediately display the Received Message . how to do this ?
regards
shakumar
shakumar
|
|
|
|
|
Normally, a thread can't receive a message if it is a working thread. If it is a UI thread, then it can have a message loop and extract messages from its queue. Of course, it can only retrieve messages when it tries to do so and if it is busy doing something else, then you can't extract the message.
Typically, it is not really done this way: you set a flag (e.g. a boolean) in one thread which can be checked in the second thread.
What are you trying to do in fact ? Some context could be usefull to help you.
|
|
|
|
|
thanks for reply
As I mentioned above it is an UI Thread only.
My query is , I able to post a message to ThreadB , from ThraedA.
When ThreadB was free it receive the message and displayed it.
When ThreadB was doing some process ,it is not displaying the received message .
After completing the ThreadB process only it display this received message.
I want ThreadB to display the Message immediately, when message was posted from ThreadA.
regards
shakumar
shakumar
|
|
|
|
|
As I explained in my previous post, this is not possible unless, you pump your message loop. This is done for example when you give back control to the MFC lib (when your function exits). It's still one thread so when you are busy in your function, nothing else will be processed for that thread.
Ok, but I also asked you a question: what are you trying to do exactly ? Give some context, it might help. What are you doing in that function that takes so much time ?
Anyway, it is also not a good idea to have lenghty function call in a UI thread, because your UI will be freezed during that time.
|
|
|
|
|
As Cedric said, you need to pump your messages, while you are busy doing something else. This means you need to add a message loop to your class , and call the loop several times while you are through a long process, to let all the awaiting messages come up.
Something like
MSG msg;
while (PeekMessage(&msg ...))
{
TranslateMessage(&msg);
DispatchMessage(msg);
}
Its never over !
|
|
|
|
|
shakumar_22 wrote: ...ThreadB should immediately display the Received Message .
How (e.g., message box, console, debug window)?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
I wrote one dialog application. For that dialog i have disabled Maximize button. In the context menu also it disabled the maximize button. But my problem is in task manager if i right click on my exe it is showing maximize option and it is maximizing the screen. How to disable this?
|
|
|
|
|
You can't do anything about that as your application can still be maximized by using ShowWindow() with SW_MAXIMIZE .
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
You could try responding to the WM_SIZE/SIZE_MAXIMIZED message with a 0 . You could also remove the WS_MAXIMIZEBOX style from the dialog template.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I have tried these things also. Still it is not working.
|
|
|
|
|
Hello Friends,
Can anybody plz tell me that is there any function in C++/MFC to get the text file format(ASCII/UniCode/ANSI) information?
Any information/segesion will be appriciated.
Thanks in ADVANCE......
|
|
|
|
|
Does IsTextUnicode() help?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi All,
I have a problem with converting MPEG to WMV and MPEG4.I got a library from net .But it converts MPEG to WMV only.It is not suitable for my needs.I want to convert the MPEG to WMV and MPEG4.Please help me...Very urgent....Thanks in advance......
Sreelal
|
|
|
|
|