|
Try stepping into the Invoke call instead of the CoCreate call. That works for me. When the new VS IDE comes up, it will be in some Microsoft ole code. If you don't have the source for the MS code you will get the kind of message you describe. Just press on.
When the new IDE opens up, open the source file(s) for your server, insert break points and hit GO. For some reason, breakpoints set up in the original IDE don't work while debugging. If you save the second environment (when prompted) the break points will be retained.
Hope this helps,
Bill
|
|
|
|
|
Hello
I am having some trouble....
I knew it was faliling at the CoCreateInstance so I did these checks...thinking that CoCreateInstance returns only one of three values and nothing else
if(hr==REGDB_E_CLASSNOTREG )
MessageBox("REGDB_E_CLASSNOTREG trouble");
if(hr==CLASS_E_NOAGGREGATION)
MessageBox("CLASS_E_NOAGGREGATION trouble");
if(hr==S_OK)
MessageBox("S_OK");
But I dont get mesg boxes.
so I tried this
DWORD d1=GetLastError();
and put a break point on the next line
d1 was 1008...which stands for An attempt was made to reference a token that does not exist.
whats that supposed to mean????
|
|
|
|
|
in debug, after the call to CoCreateInstance
on the WATCH variables window type "hr,hr" this will display the error string for the call to CoCreateInstance.
Normski - Windows Professional Programmer
|
|
|
|
|
Hi Norm
I did that and got this
E_NOINTERFACE
Nish
|
|
|
|
|
Is object properly registered, have you execeed the method count (check your IDL)?
Normski - Professional Windows Programmer
|
|
|
|
|
actually its a simple container com server
was trying out how to create a container com server
I created it as an exe
I guess that might be the whole trouble
I put a mesg box in the oevr-ridden FinalConstruct()and am getting it okay
Thus I know its registered and I also know its getting called
but some other error
by the way when I manually tried to register it using regsvr32 I got an error. apparently you are not supposed to do that. am quite new to COM and am dead-stuck!
I tried to call the same container server from VB and got some VB error message saying the component doesnot have an exposed interface or some such stuff
maybe I did something wrong with the app wizard options
there are too many options and I must have selected one wrong radio button or hit the wrong chk box...
Nish
|
|
|
|
|
prolly containing servers are a bad idea
waaaaaaaaaaaaaaaaaah
Nish
|
|
|
|
|
Whats the application do?
Normski - Professional Windows Programmer
|
|
|
|
|
The error code you got when you tried to register manually, is describing what you have done wrong in your implementation.
Placing COM objects inside a .EXE is creating what is called a Full Server. This is a common technique and works quite well.
I sounds like the problem is in the component iteself. Pay attention to the error returned from the manual registration attempt.
Hope this helps,
Bill
|
|
|
|
|
Sorry to bother you guys yet another time , but I keep getting a stack overflow whenever I call this line:
g_pThis->m_spWebBrowser2->ExecWB(OLECMDID_NEW,OLECMDEXECOPT_DODEFAULT,Var1,Var2);
I thought I was doing everything right, but I guess not...
|
|
|
|
|
Ok, I think the problem is that there is more than one item under the File->New menu. Is there any way that I could call the New->Window submenu? Possibly with a value in Var1?
If there isn't, does anyone know an easy way to open a new IE window, which my ATL object could control?
|
|
|
|
|
You can use the Navigate2 function and pass the flag navOpenInNewWindow and use about:blank for the URL.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I need to develop COM application using C++. Please help me with some complete code samples which I can execute. Also please give some reference to COM resources using C++ on Internet. Thanks in advance.
Nilotpal
Nilotpal
|
|
|
|
|
Hi,
There are some good samples of COM using C++ in MSDN.
Same you may get from MSDN online...
I think Inside-COM by Dale Rogerson is a good book...(in C++) for beginners.
Firoz
|
|
|
|
|
|
hello,
i need a little help.
i have:
1) my ATL COM (lets say A) with MFC support which calls another my ATL COM (lets say B) with MFC which uses ADO(COM)
2) my ATL COM NT service(object C) created by wizard(server type=executable)
and what's my problem?
I can create instance of object A in object C, no problems, object A can create object B, still no problems, BUT there's no way for me to force the object B to pass the Open method of ADO's Connection, i'm still geting 0x80004005 - Unspecified error.
Is there anybody there who could help me, i would really appreaciate that.
thanks a lot in advance
johny flash
|
|
|
|
|
definitely i'm not able to use even directly(without my objects descibed in the message above) ADO(COM) from executable service created with ATL COM AppWizard. Still can't open the connection, method Connection::Open
|
|
|
|
|
I have got ADO working in my NT Service without any problem.
Are you calling ::CoInitialize and CoUnitialize in all your threads. You need to load the OLe libraries in all your threads. ADO requires this as it is a COM Object.
|
|
|
|
|
it's working fine in a standard win32 console application, but not in a service EXE, i'm definitely sure that i'am calling both methods that you've mentioned
|
|
|
|
|
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")
void CServiceModule::Run()
{
//only relevant code
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, REGCLS_MULTIPLEUSE);
try{
m_pConnection.CreateInstance(__uuidof(Connection));
m_pConnection->Open("Provider=MSDASQL;DSN=XXX","","",adConnectUnspecified);
}
catch(_com_error &e){
//catched with 0x80004005 all the time
}
}
|
|
|
|
|
I created a toolbar for IE using the DeskBand ATL Object Wizard 2.0, and now I'm trying to access the IWebBrowser2 object. I specify this in the header:
CComQIPtr<iwebbrowser2, &iid_iwebbrowser2=""> m_spWebBrowser2;
and call these lines:
// Retrieve and store the IWebBrowser2 pointer
m_spWebBrowser2 = pUnkSite;
if (m_spWebBrowser2 == NULL)
return E_INVALIDARG;
But, for some reason unknown to me, m_spWebBrowser2 is always NULL! What am I doing wrong? I'm in the process of learning ATL/COM, so please excuse me if this is a newbie question .
|
|
|
|
|
Here's the code to do it.
CComQIPtr<IServiceProvider> sp = punkSite;
CComPtr<IWebBrowser2> pbrowser;
if ( sp )
sp->QueryService ( IID_IWebBrowserApp, IID_IWebBrowser2, (void**) &pbrowser ); The site doesn't implement IWebBrowser2, but it knows how to get such an interface, so you ask it for that interface with IServiceProvider::QueryService().
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Thank you! It did exactly what I wanted it to do .
|
|
|
|
|
Hi!
I developped a MMC snapin that display an ATL object in the result pane (the one to the right).
The ATL object is a Composite Control. The control is showing ok but there is no functionnality except the buttons. I would like to add a progress bar but it doesnt work.
If anyone knows how to add the progress bar and make it functionnal. Or even better, if anyone knows how to use a CDialog (or anything CWnd based) based class behind that ATL object in the result pane. Help would be very appreciated!
Thanks
Scoob
|
|
|
|
|
My goal: to be able to stop (and start, and stop again, etc...) left- and right-click events from going to Internet Explorer, AND to be able to send left- and right-click events to IE.
My situation: I've already made a toolbar for IE, and am trying to implement the above in this toolbar.
My efforts: I found the FreezeEvents method of IOleControl; would that work for part of what I want to do? If so, how do I implement it? I've gone crazy trying to figure out how to call the FreezeEvents function!
Also remember, I still need to know how to send those mouse click events to IE.
Help would be much appreciated!
|
|
|
|