|
i have access detail for ODLserver current API program as follow To access api:
user,acount,password,and the port no.I have registered thr activex.ocx
Now i want to make connection with server.
I have created a vc6 dialog based application which include activex control in that...now i am able to add active x in my dialog box...
My confusion is how to write a code which make connection with ODL server
void servertryDlg :: onloginArielapictrl1(LPCTSTR SessionId,short Accepted,LP CTSTR FailureMessafe)
{
//code
}
and
void servertryDlg :: onconnectedtoserverarielapictrl1(LPCTSTR SessionId)
{
//code
}
After getting connected to server get a session id.....
Ant kind of help will b helpful to me.....thanks
|
|
|
|
|
I need a little explaination about the MIDL compiler usage. I want to compile the IDL file that I extracted using the method described in this article:
Use regular expression in your C++ program
The article's author doesn't explain how to compile the file into the typelib and header(s).
Thanks.
Mark
|
|
|
|
|
First, find your MIDL. It's location will vary based on what VC you have installed and where, of course.
Make sure it's in your PATH. VC6 came with VCVARS32.BAT for just this thing, VS2005 has a command prompt option it installs which does pretty much the same thing.
At that point,
MIDL yourfile.idl
should then produce yourfile.tlb, and possibly other files.
Steve S
Developer for hire
|
|
|
|
|
Thanks for the tip Steve. Actually, someone pointed out that I should simply "Add to Project" the idl file and that would automatically invoke the midl compiler. Worked like a charm.
I forgot about the VCVARS32.bat file too!
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
How do I build a MFC executable that can also register as an ActiveX object? Or how do I make an Activex object an executable (instead of ocx or dll)?
I think the 1st method probably have to implement all the register and unregisters function, so I would guess 2nd method is easier.
Any information will be appreciated!
|
|
|
|
|
Generally you only use local servers (out-of-process COM objects) when the COM objects form an automation model for a different application, or for OLE linking/embedding. You might also do it if you need a separate process space, basically if you need a different security token, a huge amount of virtual memory or you're not confident in the reliability of the code. For almost all other situations you would want your COM objects to run in-process for performance.
For a local server, you must provide a marshaller. This means either sticking to Automation types and using the Automation marshaller (generating and registering a type library), generating a proxy/stub DLL, or doing it yourself. There are many scenarios in-process where you also need a marshaller, but for the simple client-calls-object-on-same-thread case (and the thread and object have compatible apartment settings) you don't.
Microsoft recommended practice these days is to use Windows Installer to install your program, and to use the Class table to register your classes, avoiding self-registration. This is so Windows Installer can detect changes to and repair the registration information if it gets overwritten.
When trying to create an instance of your class, COM can call into an in-process server to create a class factory object (DllGetClassObject). COM has no way to call into your out-of-process server directly, so you must tell it which class objects you have using CoRegisterClassObject . The MFC equivalent is to call COleObject::RegisterAll , which registers all class objects that you've declared using DECLARE_OLECREATE .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello all,
I have an activex control,which is a video player plays .cam files.I run this activex control using IE by giving its class id in <object> tag.
So whenever the IE page is opened,the activex control will be downloaded and player starts playing cam files.All camfiles uses same version of player unless until new version is updated.
Everything is working good.
The problem is, if i open two windows(IE) at a time,one player is crashing and showing error.how to overcome this problem..
1.Can i play two .cam files at a time?
2.do i need to change any code in Activex control
Plz help me..give me some suggestions..
Thanks in advance
Sunita
|
|
|
|
|
You probably have some kind of concurrency issue. You should learn about threading in COM, the apartment models, and how to handle these.
Internet Explorer uses one thread per frame, which are Single Threaded Apartment [STA] threads. You may not experience the same problem if you launch another instance of Internet Explorer from the Start menu, Quick Launch, or a shortcut, since these actions create a new IEXPLORE.EXE process.
What exactly is the displayed error message?
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I don't think the reason is from COM apartment models, ActiveX controls r working in their own apratment witch initilized by IE . what is the error message?
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
thanks for ur reply
while opening two players in two IE,one player is crashing and showing error.i got error in add-ons.
The error description is like this..
"The following addons was running when the problem was occured.and it showed details of the player dll"
Any solution for this..
i posted the same question in vc++ forum and got suggetions.they said the probelm might be due to sound resources in player.since both the player using same sound resources ,one is crashing..
I tested it by removing sound resources from Activex control(player) and ran it..but that time also i got the crashing problem.
plz help me and give some suggestions.
Thanks in advance
Sunita
|
|
|
|
|
Hi,
I`ve developed an explorer bar using ATL/WTL and i would like to add 2 features to it :
1. Assign it an accelerator, the default bars (favorites / history etc...) have them, and i`m wondering if it is possible to do the same here?
2. Have the bar display as the default view instead of the info pane that is default now.
I know someone who did this for a bar he developed using .NET - he just put all his reg. keys (from his CLSID) under the Folders View CLSID (which is {EFA24E64-B078-11d0-89E4-00C04FC9E26E}).
I tried doing the same with my bar, but i only get a grey pane and my object is not even called for/instantiated. is there something i am not implementing?
I thank in advance anyone trying to help.
(btw - you can check the app out at http://www.tomseffect.com if you`d like)
|
|
|
|
|
What i eventually did was use a Browser Helper Object (BHO) - which is loaded by default by Explorer.
I am able to use that to hook a key combination or read a Registry Value, that when either is invoked uses the IWebBrowser2->ShowBrowserBar to load my bar (using my CLSID).
The only problem is that for some reason the BHO is not loading on some computers with seamingly same setups (all WinXP with sp2 installed, etc...)
|
|
|
|
|
Hi,
I haven't work too much using com+, I'm just wondering if is there a way to retreive these values (ProgID, CLSID, Objects, Activated, Pooled, In Call, Call Time) using code. *view image link http://vertigoproject.net/question.JPG[^]
Is it there any api in order to do this??? which language? can it be done with a simple vbscript???
thx for all, regards.
Aldemar
Real Programmer isn't who just knows how to use a programming tool, Real Programmer is who knows how to write cool stuff in any language, 'cuz he/she/(it!!?) thinks like a machine .
|
|
|
|
|
Hallo!
I want create an instance of activeX at runtime and then invoke a method from this.
I create already a instance ( with cocreateinstance(...) and create a control with createcontrol(..)) ,
then i get the disid of the method with GetIDsOfNames(...).
I get the right dispid but if i want invoke this method i get a HRESULT = E_UNEXPECTED .
What do i wrong, please help me and a big thanks in advance.
<br />
......<br />
<br />
static CLSID clsid;
<br />
IDispatch *pInterface = 0;<br />
<br />
CoInitialize(NULL);<br />
<br />
HRESULT hRet = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IDispatch, (void**) &pInterface ); <br />
if(hRet!=S_OK) pInterface = 0; <br />
<br />
CString CstrMethod = "CONFIG"; <br />
BSTR BstrMethod = CstrMethod.AllocSysString();<br />
<br />
DISPID dispid; <br />
<br />
hRet = pInterface->GetIDsOfNames(IID_NULL, &BstrMethod, CLSCTX_INPROC_SERVER , LOCALE_SYSTEM_DEFAULT, &dispid); <br />
<br />
if(hRet!=S_OK) MessageBox("It is not possible to get the Id of the method!");<br />
<br />
CWnd m_ControlWrapper;<br />
RECT rct = {0,0,5,50};<br />
<br />
BOOL bStat=FALSE;<br />
bStat= m_ControlWrapper.CreateControl(clsid, "Spectrometer", WS_CHILD, rct, this, 1212, NULL, FALSE, NULL);<br />
<br />
if (bStat == FALSE)<br />
{<br />
::MessageBox (m_hWnd,"Error!!", "Could not place control", MB_OK);<br />
return;<br />
}<br />
<br />
VARIANT varResult;<br />
VariantInit(&varResult);<br />
EXCEPINFO ExceptInfo;<br />
DISPPARAMS dispparamsNoArgs = { NULL, NULL, 0, 0 };<br />
<br />
hRet = pInterface->Invoke(dispid, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &dispparamsNoArgs, &varResult, &ExceptInfo, NULL);<br />
<br />
CoUninitialize(); <br />
|
|
|
|
|
Hi,
I need create ActiveX control. I know to create ActiveX control from dialog, but
now I have dialog which use other ActiveX and I don't know how do it.
Please help me somebody. Thanks
|
|
|
|
|
Hi guys,
as I recently dig into the world of COM by reading Inside COM by Dale Rogerson, I encounter this question in the early chapters.
In the book it says you should always make a new version of interface when
- Order of functions in an interface changes
- Order of pamaters in an function changes
What exactly do this imply? The order as in the position order the fuctions or parameters listed out?
For example:
interface IX : IUnknown<br />
{<br />
virtual void __stdcall Fx() = 0;<br />
virtual void __stdcall Fy() = 0;<br />
};
changes to
interface IX : IUnknown<br />
{<br />
virtual void __stdcall Fy() = 0;<br />
virtual void __stdcall Fx() = 0;<br />
};
if it is what the book means, when it says that a new version is required, is it because that the virtual function table are no longer the same for the above two interfaces, where the functions (or in other case parameters) would reside in different memory block addresses?
Thanks~
|
|
|
|
|
Yes. If you change the order of the functions in the declaration, their positions in the interface will shift. When you derive from IUnknown, for example, you rely on the compiler putting in QueryInterface as func#0, AddRef as func#1, and Release as func#2.
When you declare the first version, Fx is func#3, and Fy is func#4. By rewriting as the second version, the positions of Fx and Fy are swapped.
This matters because COM is a binary standard, for cross-language use. If you have a client that calls methods on this interface, it is quite likely doing so by locating the function in a table. If you change the order, the table is invalid, and a call to Fx by the client would be a call to Fy instead. Replace the names 'Fx' with 'Save' and 'Fy' with 'Delete' and you'll see why this is important.
You could get around this problem by recompiling all clients, but if you haven't got source for all of them, you wouldn't be able to do this, of course.
Similarly, if you alter the order of parameters (or types, or add/remove parameters), again, this alters the shape of the interface, so you should use a new one.
Of course, while you're developing the first version, it's quite conceivable that halfway through, you'll need to change the interface, and within reason, you're able to do that without generating a new UUID (or IID) for it, but as soon as you've published it (which in general terms means installed on other than development kit), the interface should be regarded as immutable.
Steve S
Developer for hire
|
|
|
|
|
Hi Steve,
wow, thanks for the reply. That's the best answer I could've asked for.
Thanks again!
J.B.
|
|
|
|
|
I have a situation like this. I got a interface name from
the registry which i have to use. I want to work with that
object. So is there any method we can access the class object
with the the information i got (only Interface name from
registry). I dont have clsid.
Thanks
|
|
|
|
|
What programming language/enviroment you are using?
Creative minds - create creative creations!
|
|
|
|
|
Thanks for replying,
I am using visual c++ in windows 2000 Pro edition. The registry entry
tells only that we have 12 or n methods in that interface. How can we query about it.
|
|
|
|
|
Umm, if you don't have a CLSID, then it's a little difficult. You could look through all the registered TYPELIBs and see if the interface is referenced in there, which would give you some clues, but for some interfaces, there are many objects that implement the interface (such as IPersist), and it really doesn't help you.
If you could explain how you come by the interface ID, and why you don't know the CLSID, it's possible (but unlikely) that someone could help (or at least explain why you can't do it)
Steve S
Developer for hire
|
|
|
|
|
Sir,
Sorry for not explaining the context.Because i want to know that is there any way that
we can do it. The actual thing is that i had to use IDiscMaster interface. My os is
Windows 2000. I searched through net and came to know that we have to make use this
IDiscMaster Interface. I searched for it in my machine i found the key in the registry.
but i cannot find a method through which i can get the class object and along with
that i can access the interace ptr of IDiscMaster. PSFactoryBuffer is the object i think i have to get
not sure of that . How do i traverse through that IDiscMaster Interface ?.
Thank you very much
|
|
|
|
|
IDiscMaster is part of the IMAPI (Image Mastering API). This isn't supported on Win2K, only on XP (and later), so you can't create the object that would provide this interface, as it won't be installed on the system. If you check out the MSDN site, it should point you to stuff written by Paul DiLascia which uses this (April '04 issue of MSDN Magazine, IIRC).
Steve S
Developer for hire
|
|
|
|
|
I'm writing a BHO in C++ where I need to modify POST data under certain circumstances.
When I get an Invoke(dispidMember == DISPID_BEFORENAVIGATE2), the POST data is contained in pDispParams->rgvarg[2]. I need to modify that data before I leave Invoke().
Now, I could do:
m_spWebBrowser2->Stop();
m_spWebBrowser2->Navigate(...);
But Navigate() is going to fire another Invoke(DISPID_BEFORENAVIGATE2) event, and without some tricky programming, which I'd like to avoid, I'll wind up in an endless loop.
Is there any way to modify pDispParams->rgvarg[2] so that IE recognizes it upon returning from Invoke()?
|
|
|
|
|