|
hi!
I have Added a new CommandBarControl of type msoControlButton in the Menu "Inline Picture" (which is displayed when you right click on some picture or some OleObject in MS Word Document). I have also run some VBA macros on click event at this new inserted menu Item by specifying them into PutOnAction function. But now i want to call some functions of my ActiveX control's class when the user right click on my control and then select the newly inserted menu item. Is it possible if so then please help me.
Thanks
Ahmad Jalil Qarshi
|
|
|
|
|
Hello.
I am doing a research on DCOM, COM+ and .Net Remoting.
We are about to develop a license server which should communicate with all of our products (written in various languages)
I'd like to know what would be the best way to do this.
Should I use .Net Remoting? But i dont want the user to install .Net Framework if the product is written in C++.
Or would DCOM be a better solution? I heard that DCOM is a good choice in a situaltion like that?
And whats about COM+?
Maybe someone can give me some pres and cons just to get the right direction.
Thanx in advance
|
|
|
|
|
hi!
i have made a control for MS Word. Now when i insert the Control into the Word. InitNew methods is called, and when i save the document Save method of IPersistXXX is called but when i open my document the Load method of IPersistXXX is not called.
Furthermore, on reopening the document when i double click my control it displays the following message.
"This object was created in Properties.
This application is not availabe to open this object.
Make sure the application is properly installed and that it has not been deleted, moved, or renamed."
Please help me.
Thanks in advance.
Ahamd Jalil qarshi
|
|
|
|
|
When the document is opened, is an object of your type created at all? If not, I would inspect GetClassID() to see if the correct CLSID is returned.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
My name in Korean is 요르겐.
I blog too now[^]
|
|
|
|
|
Hi,
I have a MFC COM dll. when I tried to register this dll using regsvr32, I got error "DllRegisterServer entry point not found".
Can anyone help me out to know reason and solution...
thanks.
|
|
|
|
|
Check if you have properly exported "DllRegisterServer" function from your DLL.
You can check it using Depends.exe that accompanies Visual Studio.
This entry point (DllRegisterServer) is essential according to COM, for self registration of the COM Server implemented as a DLL.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
I would like to call a dll functions from MATLAB, but unfortunately the dll doesn't export its functions as a
generic dll, so using the loadlibrary function from MATLAB doesn't work. the dll actually defines a class with all its >100 public functions available.
I thought an alternative way would be to wrap the library and provide a COM interface conveniently usable from MATLAB but I couldn't find a good example. So basically I would like to upgrade a dll with a COM interface by wrapping it.
Thank you in advance for your help, examples or thoughts
Shady
|
|
|
|
|
If it defines a class with functions available it sounds like it is already created as a COM dll.
|
|
|
|
|
Thank you for your reply,
Actually the dll class doesn't define a COM interface at all, but I am now thinking of making a simple COM object which would also have inheritance from the dll class it would then have both the COM and the dll methods
available not sure if this is OK though.
Shady
|
|
|
|
|
To make it completly clear the dll .h file looks like this:
typedef int (__stdcall *PConnect) ();
typedef int (__stdcall *PConnectSimple) (int lAnInterfaceType, char *pcAComName, int lABaudRate, BOOL bAShowProt);
typedef int (__stdcall *PConnectEx) (TLS_ControlInitPar *pAControlInitPar);
typedef int (__stdcall *PDisconnect) ();
typedef int (__stdcall *PLoadConfig) (char *pcFileName);
typedef int (__stdcall *PSaveConfig) (char *pcFileName);
......
class CLStep4
{
int m_DLLResultat;
HINSTANCE m_LStep4;
PConnect m_pConnect;
PConnectSimple m_pConnectSimple;
PConnectEx m_pConnectEx;
PDisconnect m_pDisconnect;
PLoadConfig m_pLoadConfig;
PSaveConfig m_pSaveConfig;
....
public:
CLStep4();
~CLStep4();
int GetDLLLoadResult() {return m_DLLResultat;};
int Connect ();
int ConnectSimple (int lAnInterfaceType, char *pcAComName, int lABaudRate, BOOL bAShowProt);
int ConnectEx (TLS_ControlInitPar *pAControlInitPar);
int Disconnect ();
int LoadConfig (char *pcFileName);
int SaveConfig (char *pcFileName);
......
};
|
|
|
|
|
hi
i want to read a binary file and store it into one of my activeX Control's
property. i used unsigned char * as the type of the property that will hold
the data read from file. but when it calls the
IPersistStreamInitImpl::Save(....) method. the data stored in the property
of type unsigned char * is not read, displaying in output window that
ATL: Invoked failed on DISPID 3
where DISPID 3 is id of that property. plz let me know which data type to
use? or where the actual problem lies.
Thanks in advance.
Ahmad Jalil Qarshi
|
|
|
|
|
hi,
I have a wee problem, Im using TypeLibInfo in VB .NET to expose
members of COM+/COM objects. So far so good as I have been able to do many things with it, The problem comes when trying to determine the member type
i.e if it is a function or property etc. as the TLI.MemberInfo.InvokeKind
is always comming back as unknown.
thoughts?
regards
charlie
|
|
|
|
|
hi dears,
i want to write a program which can add a button in the toolbar of ms outlook. can someone help me to accomplish this task. can i do this in vb6. i shall be very thankful.
|
|
|
|
|
Hi,
There are a lot of articles on how to accomplish this. I have even managed to do it with Delphi. As long as you can create a dll you should be fine, so if you can do some code translation you should really check out this article:
http://www.codeproject.com/com/outlookaddin.asp[^]
This one is for VC++, but the principle is the same. On MSDN you will also find a lot of information, but the articles there usually refer to VS.NET and tools that come with it. If you want to right an add-in from scratch the article above will be a good place to start.
Johannes Ackermann
|
|
|
|
|
Is it possible to do exactly a client does when it releases a COM object, but from the server?
|
|
|
|
|
hi!
I want to insert an object into MS Word using function AddOleObject. i did it using visual basic 6 using the following function.
InlineShape.AddOleObject(insRange,"{7A4960FC-645E-4971-B2C4-E4C3DB896D10}","",False,False);
where insRange is of Range type. it worked fine. but the problem is that i want to do it in Visual C++6. Now the function prototype in VC++6 is hereunder
MSWord::InlineShapes::AddOLEObject ( VARIANT * ClassType, VARIANT * FileName, VARIANT * LinkToFile, VARIANT * DisplayAsIcon, VARIANT * IconFileName, VARIANT * IconIndex, VARIANT * IconLabel, VARIANT * Range )
i am a bit confused about how to use this function in VC. I tried it using following code.
VARIANT varClassType; VariantInit(&varClassType);
VARIANT varLinkToFile; VariantInit(&varLinkToFile);
VARIANT varDisplayAsIcon; VariantInit(&varDisplayAsIcon);
VARIANT varEmpty; VariantInit(&varEmpty);
VARIANT range; VariantInit(&range);
varClassType.vt = VT_BSTR;
varLinkToFile.vt = VT_BOOL;
varDisplayAsIcon.vt = VT_BOOL;
range.vt = VT_I4;
_bstr_t clsID = "{7A4960FC-645E-4971-B2C4-E4C3DB896D10}";
varClassType.bstrVal = clsID.copy();
varLinkToFile.boolVal = FALSE;
varDisplayAsIcon.boolVal = FALSE;
varEmpty.vt = VT_EMPTY;
range.lVal = 0;
MSWord::InlineShapePtr SigObj = m_pWordApp->ActiveDocument->InlineShapes->AddOLEObject(&varClassType, &varEmpty, &varLinkToFile,&varDisplayAsIcon,&varEmpty, &varEmpty,&varEmpty,&range);
but unfortunately when last line of above code executes my program crashes. i think that the problem is with my first and last parameter in the AddOleObject function. I dont know how to resolve it.
Please help me.
Thanks
|
|
|
|
|
Months ago I was doing a similar type of program, except that it was coded in C++ .NET and used COM Interop.
As I recall, the difficulty was with the VARIANT type, which can be just about anything in COM, but, has no counterpart in the CLR.
Your problem is similar; you have to use the VARIANT type in C++ (there is no natural type in C++ that would be equivalent).
I couldn't figure it out either, but, I'm fairly sure it would involve writing some kind of elaborate series of marshaling functions to structure the data correctly in memory so that COM can understand it.
|
|
|
|
|
Thanks Ursus Zeta!
the thing is that i have also tried to use this function in VC7.1 using COM. but it didn't work out. you can see from my previous post that i have used the VARIANT datatype. but don't know wht's happening. The Error indicates that there is a type mismatch. I am very upset about it. coz i have tried all the datatypes in the VARIANT type.
|
|
|
|
|
i have solved the problem using CComVariant in place of VARIANT.
i replaced the code in my first post with following 2 lines and it worked fine.
CComVariant varClsType("Ascertia.AscertiaObj.1");
MSWord::InlineShapePtr SigObj = m_pWordApp->Selection->InlineShapes->AddOLEObject(&varClsType);
|
|
|
|
|
hi all
can anybody tell me whr i can get the file formats of audio media file like
M4A
MP4
M4B
M4P
LA1
LQT
AAC
MND
MMZ
PCA
RM
RAM
RMX
RAX
so as to identify them.
and also the source code in MFC/SDK to convert them to WMA.
thanx in Advance
SUMIT
sumit kedia
sumitpkedia@yahoo.co.in
|
|
|
|
|
hi,
I read about events and implementation of connection points. I did it and it works fine in vb and c++, but not in vb/javascript!
So now my question is: does it work in IE 6.0 and vbscript/javascript too?
Please help and explain how it works
1000 thx
|
|
|
|
|
The simplest way to sink events from an external COM object in a browser page is to embed an ActiveX control in the page to subscribe to and sink the events. The main problem with this is that users have to download and install the AcvtiveX control. IE will handle this for you automatically when the page loads, but you have to get a security certificate from someone like Versign etc.or many people will not accept the download.
If you atre distributing some sort of application that users have to install anyway, you can include the ActiveX control in your setup package, and add registry keys to mark it safe for scripting and initialiuzation. In this scenario, IE never has to download the control because it is already installed, so you don't need to sign it with Versign, etc.
However, some people have their browser security set to never allow ActiveX controls to load, in which case you cannot use the control to trap the events period.
Robert
|
|
|
|
|
first of all thx very much. B U T;) isn't a 'usual' com object like one created with ATL the same as an ActiveX?
I created a com object, used ATL, connection point Notify and I get the event 'Notify' in vb, c++ but not in IE with javascript or vbscript. the com object is locally installed and registered.
I try to catch event like this:
<script language="vbscript" for="MyComInstance" event="Notify">
alert( "ev " )
</script>
but nothing happens
thx
|
|
|
|
|
The syntax you are using is for HTML page events, not sinking COM events.
You have to create the COM object instance from the web page in order for the web page to receive it's events. Then you can write event handlers.
For example,
If the COM object is already registered locally then you can use code like this (substitute the CLSID for your actual class):
-------------------------------------------------------------------------------------------
<head>
<OBJECT ID=MyCOMObject CLASSID="CLSID:BC89547C-9CC5-445D-A960-567B9B9AB93A"></OBJECT>
<SCRIPT LANGUAGE = "VBScript">
Sub MyCOMObject_Notify()
'Add code here to process your notification event
Msgbox "Trapped Notification"
End Sub
</SCRIPT>
</head>
-------------------------------------------------------------------------------------------
The COM object in this case is always loaded by the OBJECT tag when the web page loads, and unloaded when the web page unloads.
This may not be what you want. If the COM object already exists, what you have to do is write a second object that the web page can load. This second object must contain code that gets a reference to the running COM object, as well as code that allows it to act as a proxy in the web page for relaying the events from the original COM object.
Robert
|
|
|
|
|
hi and thx again,
I tried it again and again, but it don't work!!! I added a messagebox inside the Fire_Notify() method inside the com object and it seems that the IE sink is not registered in my object. the code will not jump in the "for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)"
loop where pDispatch->Invoke is called.
So I think IE simply doesn't register for events (no call for the advise stuff)! I DON'T KNOW WHY!!! anyone who knows how to force IE to do it?
thx
|
|
|
|