|
I successed to add the following line
#import "C:\WINNT\System32\MoticMotor.dll" no_namespace named_guids
but I can't still solve the problem.
As a matter of fact,the problem only appears in the SinkObj.h, 'DIID__IStageEvents' can be used successfully in the file mygrabDlg.cpp( mygrabDlg.h), "mygrab" is the file name i inputed in the Appwizard when i start to create the MFC app.
thanks!
|
|
|
|
|
I successed to add the following line
#import "C:\WINNT\System32\MoticMotor.dll" no_namespace named_guids
but I can't still solve the problem.
as a matter of fact,the problem only appears in the SinkObj.h, 'DIID__IStageEvents' can be used successfully in the file mygrabDlg.cpp( mygrabDlg.h), "mygrab" is the file name i inputed in the Appwizard when i start to create the MFC app.
thanks!
andy_cn
|
|
|
|
|
thank you very much for your reply!
I successed to add the following line
#import "C:\WINNT\System32\MoticMotor.dll" no_namespace named_guids
but I can't still solve the problem.
as a matter of fact,the problem only appears in the SinkObj.h, 'DIID__IStageEvents' can be used successfully in the file mygrabDlg.cpp( mygrabDlg.h), "mygrab" is the file name i inputed in the Appwizard when i start to create the MFC app.
thanks
andy_cn
|
|
|
|
|
Hy all!
I don't know is this the right place for this question, so my apologies if it isn't.
I have project written in C#, and now my new requirenment is that I must embed IE (i think that wizard generates ActiveX control?) in one of the forms. That control loads some html which has JavaScript code with which I must comunicate.
If anyone can shed some light on how to attack the problem, or point me the right way, I'll be grateful. And I promise if I get it to work I'll publish the code on CodeProject.
Thnx in advance.
|
|
|
|
|
For a C++ implementation, see this[^] article here on CodeProject.
It shows you how to use the IHTMLDocument2 interface to enumerate and execute JavaScript functions coded on a HTML page. As it uses a lot of COM, it may be difficult to port this to C#. The process how to call JS functions is precisely the same, though. The required functions and variables differ, though.
But reading the article will give you an idea how to execute JS functions by using COM. Next step is to implement this approach using C#.
Happy coding
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all,
Someone please explain me why COM doesnot support Multiple Inheritance incase of Interfaces
I mean why I shouldn't have
IDerived:IBase1,IBase2
I did read about it in Don Box book, but I would appreciate if someone explains it in detail (A link to some online resource would work fine too )
Thanks
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Greetings All,
I have a free threaded application with some 5 threads. In one of the threads I am creating an instance of IGlobalInterfaceTable and calling RegisterInterfaceInGlobal(..). It returns S_OK.
If I unmarhsall this interface in the same thread somewhere down the line, it works properly.
But when I create instance of IGlobalInterfaceTable in another thread, and call GetInterfaceFromGlobal(..), it returns me HRESULT of 0x8000FFFF which is Catastrophic failure.
Can anyone help?
|
|
|
|
|
Is your interface correctly registered in registry and does the project contain the correct marshalling information?
I noticed some problems with GIT when the interface wasn't properly marshalled.
|
|
|
|
|
Hi Everyone,
This is a design related issue.Let mme give you all a background of the issue. We have a local datbase implemmented in form of the binary files. One component is designed with some interfaces to access this database. Actually this component loads the binary file in its memory(as it is a out-of-proc COM component) but as this becomes very complex and it tends to be orrupt very frequently. But as we have decided to change the backend from binary file to a xml file we will not be using any code for accessing the memory mapped files instead now we want to use the xml file.
This was the past story now the real challenge is that as we cannot break the interface as there are many customers using the interfaces we have decided that we will the interfaces same and instead we will change its implementation from inside the component.
So I would like to know from yopur expreinces that what design should I follow in this scenario?
Please provide your valuable inputs and if possible some code snippets to me.
Thanks in advance
Deepak
|
|
|
|
|
Hi all,
I've created an ActiveX control using Visual C++ .NET.
When I add this control to a container created with Visual C++ .NET (or a Visual C++ 6.0) everything works and there is no apparently problem. But now, I'm trying to test this ActiveX with an application created with Visual Basic 6.0. The problem is that the ActiveX control does not appear in the list of registered components from the Visual Basic 6.0 (Menu -> Project -> Components, or Ctrl+T). So, I can't add my ActiveX to the Visual Basic 6.0 container.
When I try to make the same operation with a Visual Basic .NET container, I find the same situation, this is, the ActiveX control is not in the registered components list. But the ActiveX control is already registered.
I use the OleView application in order to ensure that the control is registered.
Due to my ActiveX control perfectly works with a Visual C++ .NET (and a Visual C++ 6.0) container, I suppose there is any bad chosen compiler option (by the time, everything is by default). Does anybody experimented the same situation testing his/her ActiveX in a Visual Basic container?
Thanks in advance.
|
|
|
|
|
want to retieve currently written text in iexlorer address bar when user
press enter button or click go button
pls help
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I have created a COM object and in my class there is an empty constructor.
Can I provide a destructor and perform cleanup there?
I need to serialize a CList to a file and then free the objects stored in the CList.
|
|
|
|
|
Yes, there's no reason why you can't provide a destructor with cleanup code.
"Oh, I'm sick of doing Japanese stuff! In jail we had to be in this dumb kabuki play about the 47 Ronin, and I wanted to be Oshi, but they made me Ori!"
|
|
|
|
|
10x
I solved the problem with simple casting, someting like:
<br />
IDispatch *pDisp = returnval.pdispVal;<br />
IResult *res = (IResult *)(pDisp);<br />
It worked very well.
|
|
|
|
|
Nooooooooooooo! You just committed a deadly COM sin. Never, ever, cast interfaces like that. Always use QueryInterface() . Do this instead:
pDisp->QueryInterface(IID_IResult, (void**)&res);
You can never know for sure what an interface pointer points to. It may point to a C++ object, but it may also point to a proxy. The object implementing IDispatch may not even implement IResult .
I repeat: always use QueryInterface() .
--
Arigato gozaimashita!
|
|
|
|
|
Wow ! Yeah, I figured, thanks for the info, I am re-writing that right now ;-]
I've got to read some books about COM, but unfortunately I don't have much time
|
|
|
|
|
btw, any idea how to get the interface pointer IID, if I dont have Named Guid constants?
|
|
|
|
|
|
Kanagu_INDIAN wrote:
qweqweqwe
wewewewewe no no no;)
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
i have two problem
the first,I want to encrypt the mail body and the attachments, but i don't know how to get the mail body and the attachments, then how to put the encrypted message into outlook and send them out?
I add an add-in to outlook, it was added when outlook was startup. i want to add two buttons in the toolbars when an new mail is creating, how can i do it?
anyone can help me? thanks!
bluesky
|
|
|
|
|
wywyongwei wrote:
I add an add-in to outlook, it was added when outlook was startup. i want to add two buttons in the toolbars when an new mail is creating, how can i do it?
anyone can help me? thanks!
i think you have to inject a dll in process space of Outlook to perform this action,i have too use this same method ,but i am sorry i can't provide source code for that.
you can look for dll injection article in CP.
wywyongwei wrote:
the first,I want to encrypt the mail body and the attachments, but i don't know how to get the mail body and the attachments, then how to put the encrypted message into outlook and send them out?
firts get the Mail Body from the outlook,ther is well defined model for MS Outlook,or you can search outlook related article in com or vc+ + section.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
I've spend several hours on this and cant understand it. I downloaded some examples and compiled. For instance the "Digital Clock and Timer ActiveX Control". But I just cant get it working. I want to use a component on a regular webpage so I tried to have it popup the aboutbox. I also tried to add another method that had the purpose to send the number "10" back. All I got was "no such method". Anyone got a working html example of how to use it please?
For the main goal. How do I make a really basic activeX thingy that can do simple C++ stuff. No graphics or such just regular math, file things, registry and so on. If theres a kind soul ot there that could provide a demoproject of such for me to learn I would be really happy.
Using VS.Net
Thanks
/HF
|
|
|
|
|
Hi,
I am developing an MFC MDI doc/view based application that uses a COM server object. The application's GUI also uses ActiveX controls for displaying data in graphs.
At first, I called ::CoInitializeEx(NULL, COINIT_MULTITHREADED); in my CWinApp derived class's InitInstance() function to initialize COM. Using this method I can make method calls to my COM server from the main application or within threads created by the main application.
However, when I added an ActiveX control to one of the views, it would ASSERT that a hwnd pointer was NULL and then show the message "An unsupported operation was attempted." after pressing ignore 3 times. It seems that the ActiveX control has trouble creating itself.
This problem was fixed by changing CoInitializeEx to AfxOleInit() (Thanks to Michael Dunn's article on COM), and after that, the ActiveX controls can show themselves without a hitch, but now any method call to my COM server from within threads won't work beacuse I did not initialize COM with COINIT_MULTITHREADED.
So my question is this: How do I use ActiveX controls and be able to call my COM server from multiple threads?
Any help would be greatly appreciated.
Thanks!
|
|
|
|
|
Can someone point me in the right direction for creating download progress information while an activeX control is installing. I presume it's some kind of callback but would appreciate some help.
thanks in advance
Carl
|
|
|
|
|
Hi,
after my first successful test with the COM server library, I inspected the registry for the ActiveDesktop object with oleview. Unfortunately, I clicked on the 'Implementation' tab and could no longer create an instance of ActiveDesktop afterwards. Oleview and also the client respond with the error message 8007007E. Has anybody an explanation for that strange behavior? How can I resolve the problem without rolling back XP?
Thanks in advance,
Ingo
|
|
|
|