|
Thanks Vishal for your quick reply, I hope your ideas help me doing the task.
Cheers
Kenia
|
|
|
|
|
Hi All,
I am working on a project that uses interop.word COM object. But I am not able to get width and style of page border of document. Can I know how I'll get these values?
Thanks in advance,
Priyank
|
|
|
|
|
Hi
I am reading this article:
http://www.ddj.com/cpp/184403558
It says:
Suppose you want to call methods on a COM object or Automation Server, but have no header files, type library (discussed later), or any programmatic information about the object. Late binding is what makes this possible. In fact, with late binding you can even instantiate and use a COM object [2] on a remote machine.
And in his code:
wcscpy(progid, L"comcalc.calc"); <br />
CLSIDFromProgID( progid, &pclsid); <br />
HRESULT hr = CoCreateInstance(pclsid, NULL, CLSCTX_ALL, IID_IDispatch, (void **)&idsp);
While late binding , If we have nothing (no need) about COM object in remote server. How could CLSIDFromProgId work? Something must be registered in client computer before executing this line so we need dll/exe file(server) itself. Am i wrong?
I don't understand how CLSIDFromProgId could work here.
Thanks...
Edit/Delete Message
|
|
|
|
|
sawerr wrote: wcscpy(progid, L"comcalc.calc");
CLSIDFromProgID( progid, &pclsid);
HRESULT hr = CoCreateInstance(pclsid, NULL, CLSCTX_ALL, IID_IDispatch, (void **)&idsp);
While late binding , If we have nothing (no need) about COM object in remote server. How could CLSIDFromProgId work? Something must be registered in client computer before executing this line so we need dll/exe file(server) itself. Am i wrong?
IMHO the above code snippet is executed on the remote machine, where the COM server is registered.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
i am trying to a add ins which can automatically create a Button inside the send item of Outlook 2007. I have used Visual Studio Tools for Office(VSTO) and created menubars, but i need button inside the send items. Could some one help me in this.
Regards,
Jerome
|
|
|
|
|
AFAIK has the Outlook COM-API a lot of collections, so can find all objects in the right collection. You got to find the right one (first in the docs and than in your program).
Greetings from Germany
|
|
|
|
|
Hi,
I've managed to create my own custom web browser using IWebBrowser2. Also, I managed to
configure HostUI things so that the browser uses theme. Now my final problem;
The ajax behavior is different from IE7 even if I use Vista to run my own browser application.
In IE7, when I click link which executes Javascript then "click" sound does not happen, but
my own browser like other customized browsers using IWebBrowser2 or MSHTML, makes
"click" sound and the web application's ajax behavior does not work like IE7.
How can I make my own browser's ajax behavior like IE7? I've created my browser application
using C and I can upload my code if needed.
Has anyone experienced this problem? It seems that as I said before, all other browsers which
uses IWebBrowser2 or IE's engine does show this behavior.
Thanks in advance.
|
|
|
|
|
I have to use more than 255 ocx im a single dialog...I am using MDS 5.0..How could I do it.
|
|
|
|
|
Hi All,
I am currently developing an Addin for Outlook 2000 and have to intercept the Send Mail event. Before sending the mail item I need to modify the Subject line to something other than original and then send the mail. I have tried DispEventAdvise but not with any success. Any pointers/suggestions are highly appreciated.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
What event you hook in DispEventAdvise?
Also you shure that DispEventAdvise called sucessfully?
|
|
|
|
|
I want to create a smart tag application using the Word Document project in .Net 2.0. The problem I should be able to show the smart tag when the user types on the word doc.
Any help would be appreciated
|
|
|
|
|
Hi,
I'm experiencing and issue regarding System.AccessViolationException : Attempted to read or write protected memory that occurs since Vista. On XP's or previous, everything run fine. To be more specific. I have a C++ ATL/COM object (created in VS 6) that is wrapped in C# .NET 2.0 . Problem occurs when handling Strings.
I've created COM using standard tools in VS 6.
this is the method definition from Interface IDL file :
[id(9), helpstring("method GetString")] HRESULT GetString([out] LPSTR* word, [out, retval] int* count);
Inferface .h Header file :
STDMETHOD(GetString)( LPSTR* word, int* count);
Code Inferface.c file :
STDMETHODIMP CLicenser::GetString(LPSTR* word, int *count)
{
*count = this->helperClass.GetCount();
*word = this->helperClass.GetWord();
cout << "word:" << *word << endl;
return S_OK;
}
Method definition in C# wrapper looks like:
int IClassNameObject.GetString(out string);
Anytime this method is called, it finishes properly (also including that Console output word:[whatever word contains]), besides in Vista, it throws that System.AccessViolationException with name of that (GetString) method after it finishes.
Method is Supposed to return a count and fill a supplied string.
If u need I can create sample project / dll , I don't have one now....
zilo
|
|
|
|
|
From your description, it looks like the problem is with the helperClass member. How does that work?
Nathan
|
|
|
|
|
If not used in any other projects I would strongly recommend that you stick to Automation-compatible types, so here you would use a BSTR rather than LPSTR. .NET understands Automation types better than raw types.
If you can't do this, you need to ensure that the marshalling and memory model are followed correctly. You need to tell MIDL that the parameter is actually a null-terminated string (use the string attribute in addition to out ) so that the data is marshalled correctly. Otherwise it assumes that the LPSTR points to a single char .
For returning a string, you must return a new buffer allocated with the system allocator, CoTaskMemAlloc . I suspect what's happening is that .NET is trying to free the returned pointer by calling CoTaskMemFree and in Windows XP, you were getting away with it.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
I wasn't able to replace LPSTR with BSTR. My knowledge about C++ is limited and I did not find corresponding conversion.
Anyway, I added string attribute and started using CoTaskMemAlloc on C++ side and so far it's working under Vista too, so thank you very much!
zilo
|
|
|
|
|
I am trying to send an array from my C# app to an ActiveX component. The array consists of floats and I have used the following declaration:
DISP_FUNCTION(MyCtrl, "SetArrayFunc", SetArrayFunc, VT_EMPTY, VTS_PR4 VTS_I2)
where SetArrayFunc looks like this:
void MyCtrl::SetArrayFunc(float *NewBuffer, short Length)
In my C# app i try the following:
ThisCtrl.SetArrayFunc(ref MyBuffer[0], (short) MyBuffer.Length);
Where of course MyBuffer is an array of floats.
However it seems as though only the first element of the array is transferred.
I have also tried using VTS_VARIANT but that did not work either.
Is there anyone here who has an idea how to solve this?
|
|
|
|
|
I would change SetArrayFunc to take an OLE SAFEARRAY. Then you should be able to pass the array directly.
Nathan
|
|
|
|
|
I'm not sure how to do that, simply replacing VTS_PR4 with SAFEARRAY gives me the following error:
"error C2275: 'SAFEARRAY' : illegal use of this type as an expression", so I guess that was not how you meant?
|
|
|
|
|
Hampus@foi wrote: I'm not sure how to do that, simply replacing VTS_PR4 with SAFEARRAY gives me the following error:
"error C2275: 'SAFEARRAY' : illegal use of this type as an expression", so I guess that was not how you meant?
SAFEARRAYs are fairly complicated. You'll need to read a bit of documentation on how to use them. If you don't have the info on your own computer, I think you can look it up on msdn.microsoft.com.
Nathan
|
|
|
|
|
Create safe array of variants where variant elements will contain the floats. Let me know if this helps.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi Everybody,
I have been trying to save a powerpoint slide from a win32 sdk application.
My Requirment is like this, From my application i need to open a powerpoint application using ole and then save the slides as bitmap .But this is not possible for me to use any mfc based application or active x control.
Can anybody please help me out in this case
Thanks in advance
Niloy
|
|
|
|
|
Hi,
I want to create a phone number control. It has text boxes for a USPhone number, an international phone number and international country code. I want it to display the USPhone field and d so in a formatted manner. If the record's Country is blank or "US" or "Canada"...
I think I can create the control. Will I be able to import it into Access and use it on a form that is bound to a table, such that I can bind this control to several fields in the table?
Thanks!
Chuck
|
|
|
|
|
Hi,
I am trying to use the Visual SourceSafe 2005 SSAPI.DLL in a simple Windows application (C++), but I can't get around an error that indicates that the classes of the DLL are not registered. I have manually registered the DLL using the REGSVR32 utility, but I still get the error.
Any help greatly appreciated.
|
|
|
|
|
Is Visual Source safe registered on your machine? If this is the case then, it is possible the construction of CoClass fails resulting CoCreateInstance returning Class not registered error.
See - http://support.microsoft.com/kb/201431
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I'm missing the OLE Container control from VB6 so ny question is
Is it possible to build a Com component which acts as an OLE container control for one specific COM EXE server?
It should provide a window for InPlaceActivation of the specific server, for example Microsoft Equation Editor.
Thankx in advance
Lennart
LLINF
|
|
|
|