|
I have read what you have said and it does not make since to me. First, stop getting down on yoyrself (A bad habit of mine). When you say "it sounds like nothing", you are correct (for some of us, in part), but that does not mean that it is. That is a matrer of who is reading your post.
I believe your problem is a bit more complecated than that.
What you are looking for is not as simple as you think, when deling with IME. It sounds like you waont to mix the two, which you (theoretcicaly) can not.
INTP
Every thing is relative...
|
|
|
|
|
Like I said the solution is simple, I just need to find the IME window and check if it is open.
Finding the window is not so simple as searching for the window title, since all the IME really is is an edit box which floats around on the screen positioning itself (usually) over the caret. This actually changes from system to system, depending on the IME version, OS and users settings.
the solution was infact very simple, and I blame myself for not seeing it in the hundreds of IME specific messages and commands.
HIMC hImc = ImmGetContext(hEdit);
if(ImmGetOpenStatus(hImc) )
return false;
|
|
|
|
|
Whoa! Major blond moment! Just ignore the stupidity below. I found the problem. I just had to change the property for this file to ignore the precompiled header.
----- stupid question follows ---------------------
I'm using Monty's HTML List Control (a real rockin' control) and I keep running into a problem with the DrawHTML.c file getting the error:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Yesterday I was somehow able to convince the compiler to accept this file, but today I keep getting this error. There must be some sort of compiler parm that's needed, but I couldn't see anything that jumped out at me by inspecting Monty's example program.
What is going on? Can anyone shed some light on this?
Thanks.
-- modified at 1:40 Tuesday 28th March, 2006
|
|
|
|
|
Abu Mami wrote: fatal error C1010: unexpected end of file while looking for precompiled header directive
It is missing the stdafx.h header file. Including this could solve your problem.
Nibu thomas
Software Developer
|
|
|
|
|
Hi Nibu, thanks for responding. However, I had already tried your suggestion and that didn't work. Since, or course, the file is a C file and not a CPP file.
Read my original post again. I found the answer and modified my original post.
Thanks
|
|
|
|
|
Abu Mami wrote: Since, of course, the file is a C file and not a CPP file.
Why do you think it won't work with a C file.
Nibu thomas
Software Developer
|
|
|
|
|
Nibu thomas wrote: Why do you think it won't work with a C file. Because when I tried it, the compiler complained that I couldn't use the precompiled header with a C file. Call me naive
|
|
|
|
|
You can give the option 'Not Using Precompiled Headers' for the file and then try to build it.
Vini
|
|
|
|
|
Thanks Vini - That in fact is what I discovered and it works just fine. Just took me a little while till I stumbled across this option.
|
|
|
|
|
Under VS2005, create a ATL project and add a simple ATL object into it.
Compile it using the x64 Configuration, all are ok! But if i add IContextMenu interface to it: first add--
public IShellExtInit,
public IContextMenu
and then add--
COM_INTERFACE_ENTRY(IShellExtInit)
COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
then the functions
STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
STDMETHOD(GetCommandString)(UINT_PTR, UINT, UINT*, LPSTR, UINT);
STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT); and in cpp file write their definitions.
All can be compiled, but the Explorer didn't load the DLL at all. And i tried using regsvr32.exe to register it, it is successful. But explorer is still didn't load the DLL, why??
I wrote nothing but "::MessageBox(NULL,NULL,NULL,MB_OK); return E_INVALIDARG:" in all function, but whenever i right click the mouse, no message box showed.
Enemy down! Go go go!
|
|
|
|
|
This trouble is already fixed, but why couldn't i use the Dll in this project, i mean invoke another dll's function in this project, it will show that:
Linking...
Creating library x64\Debug\PWContext.lib and object x64 Debug\PWContext.exp
Embedding manifest...
Registering output...
Project : error PRJ0050: Failed to register output. Please ensure you have the appropriate permissions to modify the registry.
And i am just logon as administrator and can modify the registry! Who can help me?
|
|
|
|
|
Fixed!
|
|
|
|
|
Hi all,
I am using an activex control which is registered under regsvr32. I created an MFC-dialog based aplication.I added activex control to the dialog box. And created a member-variable for the activex control thru class wizard.The member variable is m_myportcontroller.I called the activex method from a non-static member function of the dialog box using the member-variable as follows and worked fine.
ex:- void CSampleDlg::process(void)
{
m_myportcontroller.Close();
}
But i need to call the portcontroller methods from a static member function of a dialog based application (MFC).
ex:- static void CSampleDlg::process(void)
{
m_myporcontroller.Close(); // Not accessible because static function
}
Please send sample code of how to access the methods from static function. Very urgently needed.Early reply is appreciatable. Awaiting for the reply,
I had a problem in accessing Activex control methods from a static function
|
|
|
|
|
vanip wrote: But i need to call the portcontroller methods from a static member function of a dialog based application (MFC).
ex:- static void CSampleDlg::process(void)
{
m_myporcontroller.Close(); // Not accessible because static function
}
You have to create an instance of portcontroller inside the static method. That is how static methods work since they are not instance methods but class methods.
For eg:
static void CSampleDlg::process(void)
{
portcontroller pc;
pc.Close();
}
or
static void CSampleDlg::process(portcontroller& pc)
{
pc.Close();
}
vanip wrote: Please send sample code of how to access the methods from static function. Very urgently needed.
No.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks nibu thomas,
I tried this way. But getting run time assertion error.
Any other way??
|
|
|
|
|
Static member functions do not have the this pointer. So they cannot access nonstatic class member data.
In your case m_myportcontroller is declared as a non static data member.
Vini
|
|
|
|
|
Why does the function have to be static? Some kind of callback?
A lot of callbacks takes a LPVOID parameter which can be used to provide the this-pointer and in the static member function type cast it so that it's possible to access non-static member variables and functions.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks vinaya,
How to make that static?
I tried keeping static keyword in front of CPortController m_myportcontroller. But i am getting linker error. Do you know how to make that member as static??
|
|
|
|
|
Thanks Roger,
The function is to be static because, i am calling this process function in a thread. How to pass the LPVOID parameter to this process function??
|
|
|
|
|
Static member data need to be defined outside the class declaration. You can declare the CPortController member variable as static.
static CPortController m_myportcontroller ;
In the CSampleDlg cpp file, define the static variable as
CPortController CSampleDlg::m_myportcontroller;
Vini
|
|
|
|
|
The thread controlling function can be a non-static member of the class.
When you spawn the new thread with e.g. AfxbeginThread, you should pass the this-pointer as the LPVOID parameter. Your thread controlling function takes a LPVOID as argument which would now be your this-pointer. Type cast it and you'll be able to access both non-static member variables and functions from your thread.
Joe Newcomer has written a very nice article about threading that I strongly recommend everyone who is doing multithreading. You'll find it here[^]. He's got a lot of very useful tips, tricks and how-to's on his site.
When you're done with the threading stuff, a new problem may occur depending on how your ActiveX works. If you plan to use COM objects from a thread you have to initialize COM for that thread by a call to ::CoInitialize or similar. This sets up a new apartment. Now you have another problem: you can't cross apartment boundaries without marshalling the COM interface. Have a look at ::CoMarshalInterThreadInterfaceInStream and ::CoGetInterfaceAndReleaseStream for info about how to do that.
This is the correct way to do this. You have to marshal the interface. There are no shortcuts.
Post again if you have more troubles. If they are COM/ActiveX related, post your query in the COM forum.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks Vini,
i implemented , but getting comple errors. Can u specify in more detail???? please!!!
|
|
|
|
|
What are the compile errors you are getting? Specify the exact error messages, if possible.
Vini
|
|
|
|
|
We have a structure that we declare to be __declspec(allocate)'d into a particular section that we, earlier, declare with #pragma section(). This structure is never referred to by name, it is accessed by traversing the section itself.
When this structure was in our main program it was accessible. Now that I have moved it out into another library it is not. It appears that the linker has dead-stripped the symbol because it has determined that it's never getting used. I would like to be able to tell the linker to actually keep it.
Is there a keyword / link option I can use to do this?
|
|
|
|
|
hi,
Can i customize the ListCtrl Tabs & Move them when a costomize scrollbar Moves.
vinod c s
Integral Softech
|
|
|
|