|
Hi,
In my code i am having some dlls which i downloaded from a site. But while executing the code that dll is calling InvokeHelper method in CWnd class. But in InvokeHelper method i am getting some assertion failed error at file: winocc.cpp and line: 345. I am unable to understand what to do. Please help me.........
|
|
|
|
|
You have to state your problem more, like why you are using that Dll, which method of that Dll you are calling. InvokeHelper is called when there is a COM object which gets or set some properties. In this case may be you are calling some method which expects parameters guided to COM parameter passing.
|
|
|
|
|
hi,
Actually i am tring to connect my system to a handheld device with rs232 port. So, to check the connection between the device and my computer i have to use one control object dll according to OPOS standards. In my control object file i have one method for opening the port. If i call that open method, this method internally calling InvokeHelper method. In the invokeHelper method i am getting assertion failed error. This InvokeHelper method is having one pointer to a class COleControlSite this pointer is showing null. I dont know why it became null, why it is causing the error.
Please help me.............
|
|
|
|
|
So you are using onemethod of that Dll which expect a parameter as COleControlSite. Now this class is related to embedded control, in simple word when you have a container & you want to display a compound object or something like, this class plays an important role. So in your case I suppose this Dll is not the suitable option to open a port. Why do not you use various Open, CreateFile APIs?
|
|
|
|
|
|
depends upon the control you want to implement this to.
For eg:For CEdit you can see EN_SETFOCUS and EN_KILLFOCUS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
I need for Tab control.
|
|
|
|
|
Try to handle TCN_FOCUSCHANGE.
-@SuDhIrKuMaR@-
|
|
|
|
|
AnithaSubramani wrote: How to get the GetFocus and lostfocus in VC++.
This makes no sense at all. Please explain.
AnithaSubramani wrote: I need that focus ll go to next button.
See the WM_SETFOCUS and WM_NEXTDLGCTL messages.
"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
|
|
|
|
|
On parent dialog in OnCommand hendler by checking the control id of WPARAM, you can c heck which control is having the focus.
|
|
|
|
|
How Can I Load External Bitmap File "C:\\Test.bmp"
To A CBitmap Object
Thanks
|
|
|
|
|
Call LoadImage() first, then use CBitmap::Attach() .
"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
|
|
|
|
|
Thank you
I Have Tried It Before (Ask This) , But Nothing Was Happen .
Ok I Think I Am On Correct Way ,I Will Try It Again
Thank You Anyway
|
|
|
|
|
Use LoadImage() function but i think it works only for .bmp file.
-@SuDhIrKuMaR@-
|
|
|
|
|
Thank You
Yes, I Know
I Need Only Bitmap (.BMP)
Other Formats Are Not Required
|
|
|
|
|
I want to have one diferent cursor for the keyboard.
It must apear when I click the mouse left button.
danginkgo
|
|
|
|
|
So do you need to respond to the WM_SETCURSOR message?
"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
|
|
|
|
|
How can I get the value of the alpha channel for every pixel in a bitmap?
danginkgo
|
|
|
|
|
Is this a bitmap in a file, from an HBITMAP?
There are loads of resources in MSDN that will help. If you start with GetDIBits, you can follow the documentation from there.
*IF* a bitmap has an alpha layer, it will be 4 bytes per pixel, one for R, G, B, and A respectively. (Ok, I'm pretty sure A comes first).
You can look at the bitmap header, and see 32 bits per pixel set.
It's quite a bit of fiddly work, but not rocket science.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
OK, thank you for help.
danginkgo
|
|
|
|
|
I use ::GetOpenFileName instead CFileDialog to show the OpenFile Dialog.
accidently I found it(the dialog) a modeless dialog, user can click the button to show as many OpenFile Dialogs as she/he wants, this is not the thing I want.
Is it possible to make ::GetOpenFileName openfile Dialog modal?
|
|
|
|
|
You could try something like this perhaps: Code removed
Sandip's answer is the best way to go about it.
modified on Thursday, July 10, 2008 2:45 AM
|
|
|
|
|
Specify valid window handle in parameter hwndOwner
if you specify NULL it would create modless dialog.
i hope it helps.
Regards,
Sandip.
|
|
|
|
|
I always specify the hwndOwner, it doesn't work.
|
|
|
|
|
i tried this and it works fine for me.
void CTrialMFCDlg::OnOK()
{
OPENFILENAME ofn;
char szFile[260];
HWND hwnd;
HANDLE hf;
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = this->GetSafeHwnd();
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if (GetOpenFileName(&ofn)==TRUE)
MessageBox("Open");
else
MessageBox("Cancel");
}
Regards,
Sandip.
|
|
|
|