|
In a COM+ Application( single server and multiple clients ), a client call some method provided by the server through out RPC, the problem is, if both the client and the server have a same NT account, the client can works well, but if the client is loged on with another account, it can't work.
Could any body help me?
Thx
|
|
|
|
|
Check DComCnfg utility. You will need to change access/security rights.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
|
Hello friends,
I am a student at an engineering college and I am working on my major project. I am stuck at one step. I made a program in matlab which reads an xls file and does some mathematical operations on it(fminsearch).
Now I need to use this program in Visual Basic. For this I made a DLL file of the project using mbuild. But I am unable to write the VB code to use the file.
Can anyone please help me out. This step is of high importance to me. Without this I am lost.
Waiting for your response.
email--accessmohit@gmail.com
|
|
|
|
|
|
Hello there
How COM object can support .NET serialization ? I mean, I have a simple COM object implementing persistence through IPersistStreamInit interface and would like to serialize my COM in .NET serialization process. Does COM interop support COM persistence in .NET serialization process ?
I tried many ways but so far I failed. I was able to implement .NET ISerializable interface in my COM object (but what about "older" COM objects, which I cannot redesign ?) but still missing in interop class .NET SerializabeAttribute makes me confused. Should I build a wrapper around interop wrapper (or build totally my own) to satisfy SerializableAttribute requirement ?
Thank You
|
|
|
|
|
Hi Everyone
I am trying to construct a CComBSTR object containing a long string and I found the CComBSTR could only accept the limited number of characters, those character after that are discarded.
Here is my code:
CComBSTR bsCode;
bsCode.Append("document.bgColor='yellow';alert('a demo message');var retValue = document.bgColor;var heads = document.getElementByTagName('head');heads[0].setAttribute('JDIC_BROWSER_PROP', retValue);");
Debugging result shows the bsCode only contains the following characters:
"document.bgColor='yellow';alert('a demo message');var retValue = document.bgColor;var heads = document.getElementByTagName('he"
I tried several other way to solve this problem but all failed. The way I tried include:
1. Not using Append, providing the content during the construction
CComBSTR bsCode("document.bgColor='yellow';alert('a demo message');var retValue = document.bgColor;var heads = document.getElementByTagName('head');heads[0].setAttribute('JDIC_BROWSER_PROP', retValue);");
2. Like the way above, but specify a big enough length of the CComBSTR
CComBSTR bsCode(1024, "document.bgColor='yellow';alert('a demo message');var retValue = document.bgColor;var heads = document.getElementByTagName('head');heads[0].setAttribute('JDIC_BROWSER_PROP', retValue);");
Each way all lead to the same result.
I am quite confused. Is it true that CComBSTR only support "short" string?
-Paul
|
|
|
|
|
It's the Debugger limitation not the CComBSTR. I don't think that the Debugger should show string's megabytes for you.
Call the Debug Windows -> Memory (Alt+6) and type "*bsCode.m_str" in Address field. Sure that all bytes on a place.
Or check the bsCode's size by bsCode.Length().
With best wishes,
Vita
|
|
|
|
|
Hi Vita
You are right. Thanks a lot for your help.
Best Regards
-Paul
|
|
|
|
|
Can anybody provides a link to that example? i need a step by step example to create a simplest "hello world" C++ DLL by using Visual Studio.Net 2003
Thanks for viewing
regards;
webdevelopex
|
|
|
|
|
Hi
Run the Wizard;
1. New Project -> Visual C++ Projects -> Win32 -> Win32 Project
2. Application Settings -> DLL -> Export Symbols
Shows you how to export a class, variable and function.
Martin
|
|
|
|
|
Oops! Sorry, I didn't read your message properly.
I'll go away now...
|
|
|
|
|
hello,
can any body give me these controls which r related to MS project server.
PjOutlook.ocx,PjOffline.ocx,PjQuery.ocx,PjSecurity.ocx,PjUpdate.ocx,
PjCalendar.ocx,PjGrid.ocx,PjTextConv.dll,PjRes10c.dll,Pj10ENUc.dll
Amal
|
|
|
|
|
hi,
can anyone tell me how macromedia does their silent install for the flash player?
all suggestions welcome
thanks
|
|
|
|
|
Home > Software > Internet Explorer IE5 Programming Components Browser Control > How to open Web...
Post 1 of 1
Topic 259 of 260
How to open Web Browser from Outlook Addin
by "devom" <devom@rediffmail.com> Jan 14, 2005 at 02:30 AM
I had created an Outlook Addin using VC++ ATL.There I had created button on
Outlook Toolbar.I
want to open a Web Browser window on clicking on the button.The web
Browser Window could not have any
Buttons,Toolbars etc.eg.I just want to open www.rediff.com in the window
upon initialisation.Next, I want to capture
click events on the rediff page.(Eg. on what picture in the html page did
the user clicked)
How should .I move forward .Plz explain with steps
Thanks in advance
|
|
|
|
|
Hi
You can host the 'Shell.Explorer' ActiveX control - it's in the shdocvw.dll server in ...\windows\system32.
With ATL, you'll be able to use CAxWindow (or derived) and either use the IWebBrowser(2) from the Platform SDK's header files or simply #import shdocvw.dll.
IWebBrowser(2) provides a method to browse, eg. to www.rediff.com, called Navigate(2).
Once you've loaded the page, you can access the HTML Document from the Document property (returns IDispatch interface).
The Doc also implements IHTMLDocument/IHTMLDOMNode(2), which you can find in mshtml.tlb (using #import) or the Platform SDK.
From the IHTMLxxx API you can find the elements in the page itself.
A word of caution though; there is no real way to tell when a page has loaded as the events such as, BeforeNavigate(2), OnDocumentComplete, etc only notifies of progress for individual document elements, and since most pages contain many such elements, you have to 'look out' for the bits you're concerned with - and then there's always the case where the server isn't running (etc) which you'll also want to handle properly.
HTH and good luck
Martin
|
|
|
|
|
This one is for IDL gurus!!
Given a structure similar to the following, defined in IDL
typedef struct
{
long something;
[string]wchar_t * someotherthing;
[string]wchar_t * yetanotherthing;
}SOMESTRUCT
I need my component to return a collection of SOMESTRUCT structures. (The exact number of SOMESTRUCT structures is not known until runtime)
There are two options here
1. Use an open(or whatever) array of SOMESTRUCT structures. Can someone give me the IDL for this?
2. Define IEnumXXX for the SOMESTRUCT structure. Is there some sample code somewhere?
thanks
Man Learns from History that he never learns from History
|
|
|
|
|
Go for the first alternative. The syntax is the same as for basic types IIRC.
--
Komm tu mir langsam weh, leg mir die Ketten an
und zieh die Knoten fest, damit ich lachen kann
I blog too now[^]
|
|
|
|
|
Hi!
It's possible to mark a CoClass as "appobject". This enables VBScript clients to use methods in this object globally. However, I'm not able to use these methods from a C++ client.
The following example tries to invoke the "CentimetersToPoints" method, which is global in the Word-typelib. Just create a Win32 console app with ATL support and paste it in...
What am I doing wrong?
Sincerely
-Broholm
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
#include "stdafx.h"<br />
<br />
#define hrCheck(hr) if(FAILED(##hr)) { return -1;};<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
::CoInitialize(NULL);<br />
{
CComBSTR ProgId("Word.Application");<br />
HRESULT hr; <br />
<br />
CComPtr<IUnknown> pUnk;<br />
hr = pUnk.CoCreateInstance(ProgId,NULL,CLSCTX_SERVER);<br />
hrCheck(hr);<br />
<br />
CComQIPtr<IDispatch> pDisp;<br />
hr = pUnk.QueryInterface(&pDisp);<br />
hrCheck(hr);<br />
<br />
DISPID dispIdClass;<br />
CComBSTR MethodName("CentimetersToPoints");<br />
hr = pDisp->GetIDsOfNames(IID_NULL,&MethodName,1,LOCALE_USER_DEFAULT,&dispIdClass);<br />
hrCheck(hr);<br />
<br />
CComVariant vArg(0.5);<br />
hr = vArg.ChangeType(VT_R4);
hrCheck(hr);<br />
DISPID dispidNamedArgs = -1;<br />
<br />
DISPPARAMS dpArgs;<br />
dpArgs.cArgs = 1;<br />
dpArgs.cNamedArgs = 0;<br />
dpArgs.rgvarg = &vArg;<br />
dpArgs.rgdispidNamedArgs = &dispidNamedArgs;<br />
<br />
EXCEPINFO e;<br />
CComVariant vResult;<br />
UINT puArgErr(0);<br />
<br />
hr = pDisp->Invoke(dispIdClass,IID_NULL,LOCALE_USER_DEFAULT,DISPATCH_METHOD,&dpArgs,&vResult,&e,&puArgErr);
if(FAILED(hr))<br />
std::cout << "Invoke failed" << std::endl;<br />
CComPtr<ITypeInfo> pTI;<br />
hr = pDisp->GetTypeInfo(0,LOCALE_USER_DEFAULT,&pTI);<br />
CComQIPtr<ITypeLib> pTypeLib;<br />
UINT TLindex(0);<br />
hr = pTI->GetContainingTypeLib(&pTypeLib,&TLindex);<br />
hrCheck(hr);<br />
<br />
UINT iTypeInfoCount = pTypeLib->GetTypeInfoCount(); <br />
for(UINT i(0); i < iTypeInfoCount; ++i) <br />
{<br />
TYPEKIND typeKind; <br />
hr = pTypeLib->GetTypeInfoType(i, &typeKind);<br />
hrCheck(hr);<br />
if(typeKind != TKIND_COCLASS) <br />
continue;<br />
<br />
CComQIPtr<ITypeInfo> pAOTypeInfo;<br />
hr = pTypeLib->GetTypeInfo(i, &pAOTypeInfo);<br />
hrCheck(hr);<br />
<br />
TYPEATTR* pAOTypeAttr;<br />
hr = pAOTypeInfo->GetTypeAttr(&pAOTypeAttr);<br />
hrCheck(hr);<br />
if((pAOTypeAttr->wTypeFlags & TYPEFLAG_FAPPOBJECT) != TYPEFLAG_FAPPOBJECT)<br />
{<br />
pAOTypeInfo->ReleaseTypeAttr(pAOTypeAttr);<br />
continue;<br />
};<br />
<br />
CComBSTR name;<br />
hr = pTypeLib->GetDocumentation(i, &name, 0, 0, 0);<br />
hrCheck(hr);<br />
<br />
for(int j(0); j < pAOTypeAttr->cImplTypes; ++j)<br />
{<br />
CComQIPtr<ITypeInfo> pAOTypeInfoImpl;<br />
HREFTYPE hRefType;<br />
hr = pAOTypeInfo->GetRefTypeOfImplType(j,&hRefType);<br />
hrCheck(hr);<br />
hr = pAOTypeInfo->GetRefTypeInfo(hRefType,&pAOTypeInfoImpl);<br />
hrCheck(hr);<br />
TYPEATTR* pAOTypeAttrImpl;<br />
hr = pAOTypeInfoImpl->GetTypeAttr(&pAOTypeAttrImpl);<br />
hrCheck(hr);<br />
<br />
CComPtr<IDispatch> pAODisp;<br />
hr = pAOTypeInfo->CreateInstance(NULL,pAOTypeAttrImpl->guid,(void**)&pAODisp);<br />
pAOTypeInfoImpl->ReleaseTypeAttr(pAOTypeAttrImpl);<br />
hrCheck(hr);<br />
<br />
hr = pAODisp->GetIDsOfNames(IID_NULL,&MethodName,1,LOCALE_USER_DEFAULT,&dispIdClass);<br />
hrCheck(hr);<br />
hr = pAODisp->Invoke(dispIdClass,IID_NULL,LOCALE_USER_DEFAULT,DISPATCH_METHOD,&dpArgs,&vResult,&e,&puArgErr);<br />
hrCheck(hr);
<br />
};<br />
pAOTypeInfo->ReleaseTypeAttr(pAOTypeAttr);<br />
};<br />
};<br />
::CoUninitialize();<br />
return 0;<br />
}<br />
|
|
|
|
|
I think that your problem doesn't associate with [appobject] keyword of MIDL. Because the CentimetersToPoints is a member of _Application interface of Application coclass which doesn't have [appobject] tag.
Try to make the initialization of the "EXCEPINFO e". May be it helps you.
With best wishes,
Vita
|
|
|
|
|
I've already tried that, with no luck... It's just that I'm able to create, write and print Word documents, and use the SAPI interface to make the computer speak with this code already. But a simple function call to convert a number fails?
|
|
|
|
|
Unfortunately, I don't have the Word installed now. But your code should be work.
Try also change the dwClsContext parameter of CoCreateInstance to:
pUnk.CoCreateInstance(ProgId,NULL,CLSCTX_LOCAL_SERVER)
With best wishes,
Vita
|
|
|
|
|
I found the error:
Apparently it's neccesary to specify DISPATCH_METHOD|DISPATCH_PROPERTYGET in the Invoke-statement. Neither DISPATCH_METHOD or DISPATCH_PROPERTYGET alone will do the trick...
But thx for replying anyway...
Sincerely
Broholm
|
|
|
|
|
Hi
Would you say it is better to learn COM using straight COM or use ATL to do the donkey work? I appreciate this could be horses for courses, but for example, if you needed a component that connected to a server to retrieve docs / images etc and serve them to the client, no GUI, would straight COM be just as good?
The main reason for asking is I am struggling to understand the basics of ATL but the straight COM seems easier, i.e. derive from IDespatch, derive from IUnknown, whereas ATL does all that for you and I can't really work out what it happening.
Also WTL fits nicely with ATL so a GUI COM would be better built using ATL?
I suppose it's like MFC, hides all the Window Procs from you etc...I started out using the Windows SDK so I know what's happening in the background and could appreciate what MFC was doing under the covers.
Just rambling really.....
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Hi
You would do good to at least create a basic DLL (inproc) server using just straight C++, to understand the principles. From there on, move to ATL as it's the best framework for COM with C++ available today (.. says he, bracing for the flack..).
It is the same as doing a basic Win32-only app to understand MFC better.
When I looked at it last, MFC was much richer than WTL for GUI work, but WTL certainly complements ATL well if you're aiming to build light-weight ATL COM servers with some basic GUI bits, such as a dialog or 2.
Before VC7, MFC used to be imported into ATL projects only to use the utility classes, such as CString, but with ATL 7 that's not necessary anymore as these are now better de-coupled.
HTH
Martin
|
|
|
|
|