|
The problem is that the standard MS-includes includes the MSXML header files themself. Either you skip the import or skip using the namespace.
Pretty annoying anyway.
|
|
|
|
|
I have finished a simple component and deployed it in component Services,
then I exported the application proxy and installed it in another computer which to make as a client.
This client computer is in the same work group with the server computer.
But when an application in client uses this proxy , there an error happen : "Permission denied."
When I create a same account as the server computer and log in the client computer with this account
this application can use this proxy.
Must this account in client be the same asthe server computer?
I heard that the client and server should be in the same domain in com+,
How to configure the domain?
Where can I get some document about this?
TIA
Hello everyone
|
|
|
|
|
Hi,
I want to make a mimic (graphic) editor in which images will be displayed dynamically on click of button, will be resized, moved and finally, they will be connected to database. For that purpose I want to use "image edit activex control"
basically,I’ve to make a graphics editor in which when i press a specified button a picture should be displayed on the dialog.that picture will be associated with a variable in a table of a database. when the value of that variable changes in the database another picture is pasted on the previous picture.i-e a picture of engine is normal when variable is 1...but when the value is 0 the color of engine changes to red.
note:
-pictures are moveable and resizable.
-there can be alot of pictures on the dialog at a time.
-value in the database changes automatically through another program.
i m using kodak Image Edit activeX control for this purpose..i add the control in the project and create it on runtime with the help of create function Uptill now I am able to create the control dynamically with the required image displayed on it which can also be flipped on click event. I want to know how the dynamically created control be made able to move and resize.
any help how to do that? m i going in the right direction?bcz previously i was doing all this with the help of CBitmapButton.(information on how i did that available on demand if anyone interested)
i also came to know that exactly the same problem is encountered to "asimatta" who sent the message on EXPERT EXCHANGE website under the topic Languages\C++\ on 08/27/2003 but i coudn't contact bcoz i m unable to buy points to send a message
i m really grateful to code project for free service!!
plz help me !! thanking u in anticipation
Regards,
nsaadyah
Saadyah Nisar
NSaadyah
|
|
|
|
|
I have a problem in Win 2003 while trying to register my Serviced Component.
The type library is created, but this error is generated to me:
System.EnterpriseServices.RegistrationException: Could not install type library 'f:\moses\vb\mcad\2557abuildingcom+\democode\vb\mod02\JITTest.tlb' into application 'JIT Test'.
Server stack trace:
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary_W2K(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallAssembly(RegistrationConfig regConfig, Object obSync)
at System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
This error is generated when using Dynamic or manual regeistration
Can anybody help me in this please??
Note, I tested this app on Win 2000 Advanced Server and windows XP and it works just fine with no erros and the tlb, regeistration and installing is done successfuly!!!
|
|
|
|
|
i have added COM (xxclientx.dll) to my c# webproject.
as
using XMLProLib = XXCLIENTXLib;
& initialize as
public string GetGDSResponse(string GDSRequest)
{
XMLProLib.Client GDSClient = new XMLProLib.Client();
GDSClient.Host = "xmlpro.wspan.com";
GDSClient.Port = 8800;
etc......
}
most of times work & suddenly getting error as
System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure at GetGDSResponse(String GDSRequest)
it doesnt recover then need to restart computer ...
can you give me the solution for this.
please help me
thanks and regards
abhi
|
|
|
|
|
How can I create a simple ActiveX control, that has no GUI. I want to create a simple ActiveX control that is not visible in rutime in the client (like Visual Basic). It should be only display an little Icon during the design time in the client (VB), like the MsCOMM control.
Any link, tutorial, sample?
Thanks!
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
I believe that the switch "Invisible at runtime" does it (ATL wizard).
|
|
|
|
|
And how can I display a icon at design time?
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
simply, the OnDraw method works as before, only the results will be visible only in design mode - you don't need to take special steps.
I just tried it (because I never did it before) and the sample generated by the wizard implements the OnDraw with the standard "ATL:Test " but it was visible only in design time. In runtime it shows nothing.
hope this helps
|
|
|
|
|
Thanks! I will try it!
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Hi there,
my requirement is such that i have to have a singleton based exe or dll server. Dll is better choice.
Now when i use the DECLARE_CLASSFACTORY_SINGLETON macro on exe local server no problem happens and i have a singleton allright.
I have done debugging on that and the same object is returned using
CoCreateInstance
now i want to use an inproc server and i want it to be singleton as you know the requirement are but when i debug it there are seperate object formed for each client instance attaching.
and it doesn't care about the macro.
I know that for every process mapping of a dll is done but i want some mechanism of COM which let me have a single instance dll inproc server.
I need a solution to this problem otherwise i have to stick to expensive marshalling.
|
|
|
|
|
Hi there,
my requirement is such that i have to have a singleton based exe or dll server. Dll is better choice.
Now when i use the DECLARE_CLASSFACTORY_SINGLETON macro on exe local server no problem happens and i have a singleton allright.
I have done debugging on that and the same object is returned using
CoCreateInstance
now i want to use an inproc server and i want it to be singleton as you know the requirement are but when i debug it there are seperate object formed for each client instance attaching.
and it doesn't care about the macro.
I know that for every process mapping of a dll is done but i want some mechanism of COM which let me have a single instance dll inproc server.
I need a solution to this problem otherwise i have to stick to expensive marshalling.
|
|
|
|
|
Hi, I am planning to start ATL Com programming. Can anybody suggest a good starting point / online tutorial ?
Thanks
|
|
|
|
|
::CoInitialize(NULL) ?
(Sorry, couldn't resist)
|
|
|
|
|
I am working with a WebBrowser (IE). I want to know the screen position of the top left coordinate, from where the browser renders the html page i.e. top left of the page, we actually see in the browser. This should exclude the menubar, address bar, standard buttons toolbar and any toolbars like google etc. I checked the IWebBrowser2 API that give the top and left (get_top and get_left) coordinates, but its of the entire browser window. I want the one without the toolbars etc.
- Nikhil
|
|
|
|
|
An COM writed with ATL has a parameter which type is BSTRS.
such as
STDMETHODIMP CPNRTool::GetPNRInf(BSTR PNRNo, BSTR* PNRInf, LONG* Flag)
An application writed by VB call this COM such as
Dim sPNRNO As String
Dim sPNRNO As String
Dim lLog As Long
Dim DCSTool As DCSTool.CPNRTool
Set DCSTool = New DCSTool.CPNRTool
Call DCSTool.GetPNRInf(sPNRNO, sPNRInf, lLog)
Set DCSTool = Nothing
After finish call, I am doubt whether I need to release the memory of param"PNRInf" and "Flag"
and how to release?
Will this situation make memory leaks?
TIA
Hello everyone
|
|
|
|
|
|
The situations here and there are not identical. VB supports perfectly the [out,retval] parameter. He also supports the [in,out] parameter. But I'm afraid that VB does not support the [out]-only parameter.
[idl] HRESULT SomeTestMethod([out] BSTR *pVal);
Dim s As String
s = "SomeText"
...
Call obj.SomeTestMethod(s)
' Here s will contain the new value. But old value will be freed or not?
The like example from C++:
BSTR s = SysAllocString(L"SomeText");
...
obj->SomeTestMethod( &s );
' Here s will contain the new value. But old value will never be freed.
With best wishes,
Vita
|
|
|
|
|
True enough.
There is a catch when non-VB clients call, of course, in that the BSTR* passed in must be either set to NULL or a valid BSTR, and not contain a random value, or the called object faults.
This happens, for instance, when uninitialised BSTR values are used from a C++ client.
The moral is for lower-level programmers to always init data to a known value.
Steve S
|
|
|
|
|
Hello Vita,
I wrote a simple VC++ ATL COM Object that implements SomeTestMethod() as described above (it takes an [out] parameter of type BSTR*). I ran a VB test client that performs the exact same calls as described :
Dim s As String
s = "SomeText"
...
Call obj.SomeTestMethod(s)
Listed below is my SomeTestMethod() implementation :
STDMETHODIMP CTest2::SomeTestMethod(BSTR *pbstr)
{
// TODO: Add your implementation code here
if (*pbstr)
{
::SysFreeString(*pbstr);
*pbstr = NULL;
}
*pbstr = _bstr_t(TEXT("New BSTR.")).copy();
return S_OK;
}
I noted that when control gets into SomeTestMethod(), pbstr points to a BSTR but that BSTR is actually NULL. Hence the contents of the "if" statement :
if (*pbstr)
{
::SysFreeString(*pbstr);
*pbstr = NULL;
}
did not get executed. This is because "*pbstr" is actually NULL. This makes me suspect strongly that the VB runtime will actually free the BSTR in "s" before passing it by reference to SomeTestMethod().
The rest of the function :
*pbstr = _bstr_t(TEXT("New BSTR.")).copy();
works as expected.
When I get the VB test client to display "s" (in a MsgBox) after calling SomeTestMethod(), the displayed text is indeed "New BSTR."
Hope the above can be of help.
Best Regards,
Bio.
|
|
|
|
|
Hi guys!
I'm trying to insert a DropdownButton in my Outlook plugin...a msoControlButtonDropdown button, but I just don't know how!
Here is (a piece of)my code:
CComVariant vToolBarType2(msoControlDropdown);
CComPtr < Office::CommandBarControl> spNewBar;
spNewBar = spBarControls->Add(vToolBarType,vEmpty,vEmpty,vEmpty,vShow);
ATLASSERT(spNewBar2);
The problem is that the Add Method only accepts as the first parameter msoControlButton, msoControlEdit, msoControlDropdown, msoControlComboBox, or msoControlPopup; and I want to use msoControlButtonDropdown.
Any ideas how should I do this, or how should I go around it?
As you see, the code is written in ATL / C++, but even if you have a VB sample, I guess it should do the trick.
Thanks a lot,
Doru K.
|
|
|
|
|
I am searching for a way to create a DVTARGETDEVICE structure with the information from the currently selected printer in a MFC application. Is there a way to do this automatically (e.g. if I have a CDC object)?
If this is not possible, how do I create the DVTARGETDEVICE structure if I have the DEVNAMES and DEVMODE structures.
Unfortunatly the MSDN docu is not very good here and I have not found any information about that.
By the way, why do I have to use a DVTARGETDEVICE, an Information context AND a Device context in so many COM methods (like IViewObject::Draw)? The 2 HDCs I have should be enough!?
Thanks in advance for your help.
|
|
|
|
|
OMG, I like those MS guys. After wasting 1 day, I finally found out how MS internally do it!
There is an internal function in OLEMISC.CPP called _AfxOleCreateTargetDevice. It takes the DEVAMES and DEVMODE structures and returns a the DVTARGETDEVICE structure:
Here is the code of this function:
<br />
DVTARGETDEVICE* AFXAPI _AfxOleCreateTargetDevice(LPDEVNAMES pDN, LPDEVMODE pDM)<br />
{<br />
USES_CONVERSION;<br />
<br />
DVTARGETDEVICE* ptd = NULL;<br />
DWORD dwDevNamesSize, dwDevModeSize, dwPtdSize;<br />
<br />
LPCTSTR lpszDriverName = DEVNAMEPART(pDN, wDriverOffset);<br />
LPCTSTR lpszDeviceName = DEVNAMEPART(pDN, wDeviceOffset);<br />
LPCTSTR lpszPortName = DEVNAMEPART(pDN, wOutputOffset);<br />
<br />
LPCOLESTR lpszDriverNameOle = T2COLE(lpszDriverName);<br />
LPCOLESTR lpszDeviceNameOle = T2COLE(lpszDeviceName);<br />
LPCOLESTR lpszPortNameOle = T2COLE(lpszPortName);<br />
int nDriverNameSize = (lpszDriverNameOle == NULL) ? 0 : (ocslen(lpszDriverNameOle)+1)*sizeof(OLECHAR);<br />
int nDeviceNameSize = (lpszDeviceNameOle == NULL) ? 0 : (ocslen(lpszDeviceNameOle)+1)*sizeof(OLECHAR);<br />
int nPortNameSize = (lpszPortNameOle == NULL) ? 0 : (ocslen(lpszPortNameOle)+1)*sizeof(OLECHAR);<br />
<br />
LPDEVMODEOLE lpDevModeOle = DEVMODET2OLE(pDM);<br />
<br />
dwDevNamesSize = nDriverNameSize + nDeviceNameSize + nPortNameSize;<br />
dwDevModeSize = (DWORD)(lpDevModeOle->dmSize + lpDevModeOle->dmDriverExtra);<br />
<br />
dwPtdSize = sizeof(DVTARGETDEVICE) + dwDevNamesSize + dwDevModeSize;<br />
<br />
if ((ptd = (DVTARGETDEVICE*)CoTaskMemAlloc(dwPtdSize)) != NULL)<br />
{<br />
ptd->tdSize = (UINT)dwPtdSize;<br />
<br />
ptd->tdDriverNameOffset = sizeof(DVTARGETDEVICE);<br />
ocscpy((LPOLESTR)((BYTE*)ptd + ptd->tdDriverNameOffset), lpszDriverNameOle);<br />
ptd->tdDeviceNameOffset = (WORD)(ptd->tdDriverNameOffset + nDriverNameSize);<br />
ocscpy((LPOLESTR)((BYTE*)ptd + ptd->tdDeviceNameOffset), lpszDeviceNameOle);<br />
ptd->tdPortNameOffset = (WORD)(ptd->tdDeviceNameOffset + nDeviceNameSize);<br />
ocscpy((LPOLESTR)((BYTE*)ptd + ptd->tdPortNameOffset), lpszPortNameOle);<br />
ptd->tdExtDevmodeOffset = (WORD)(ptd->tdPortNameOffset + nPortNameSize);<br />
memcpy((BYTE*)ptd + ptd->tdExtDevmodeOffset, lpDevModeOle,<br />
sizeof(DEVMODEOLE)+lpDevModeOle->dmDriverExtra);<br />
}<br />
return ptd;<br />
}<br />
And here is a sample from me and the MS file OLEDOCCL.cpp how to use, incl. getting the current application printer:
<br />
PRINTDLG pd;<br />
pd.lStructSize=(DWORD)sizeof(PRINTDLG);<br />
AfxGetApp()->GetPrinterDeviceDefaults(&pd);<br />
<br />
DVTARGETDEVICE* pTargetDevice = NULL;<br />
LPDEVNAMES lpDevNames = NULL;<br />
LPDEVMODE lpDevMode = NULL;<br />
<br />
lpDevNames = (LPDEVNAMES) GlobalLock(pd.hDevNames);<br />
if (lpDevNames != NULL)<br />
{<br />
lpDevMode = (LPDEVMODE) GlobalLock(pd.hDevMode);<br />
if (lpDevMode != NULL)<br />
{<br />
pTargetDevice = _AfxOleCreateTargetDevice(lpDevNames, lpDevMode);<br />
if (pTargetDevice != NULL)<br />
{<br />
CoTaskMemFree(pTargetDevice);<br />
} <br />
GlobalUnlock(pd.hDevMode);<br />
}<br />
GlobalUnlock(pd.hDevNames);<br />
}<br />
Thx MS for the "good" documentation!
|
|
|
|
|
I have wrote a SDI windows application(MyApp.exe) with an automation IDispatch interface for remote control. My problem is that I want to connect my client program to a running instance of MyApp.exe, rather than start up a new instance.
I succeeded doing this by changing the orignal initialisation
pIMyApp = new IMyApp;<br />
pIMyApp->CreateDispatch( "MyApp.Document" );
to the lines
pIMyApp = new IMyApp;<br />
CLSID clsid;<br />
if ( CLSIDFromProgID( OLESTR( "MyApp.Document" ), &clsid)==NOERROR)<br />
{<br />
IUnknown *pUnknown=NULL;<br />
HRESULT hr=GetActiveObject(clsid,NULL,&pUnknown);<br />
if ( SUCCEEDED(hr) )<br />
{<br />
IDispatch *pIDispatch=NULL;<br />
hr=pUnknown->QueryInterface(IID_IDispatch,(void **)&pIDispatch);<br />
if (SUCCEEDED(hr) )<br />
{<br />
pIMyApp->AttachDispatch(pIDispatch,FALSE );<br />
bInitialised = true;<br />
}<br />
pUnknown->Release();<br />
}<br />
}
which attaaches pIMyApp interface pointer to the running instance of MyApp.exe (the IMyApp is registered in the Running-Object-Table) on my own computer.
I want be able to do the same on a remote computer. Is it possible to get apply GetActiveObject() to a remote instsance? The MS Knowledge base has a over complicated example
of achieving this for a program called ROTMONK.EXE which seems over complicated to me.
As I missing something? Does anyone know of a straightforward way of achieving a connection to a runing instance on a remote computer? Or more importantly, does anyone have any suggestions of a better way of achieving my aim?
|
|
|
|
|
GetActiveObject cannot be applicable by ROTMONK.EXE's manner because the moniker by which the object is registered in ROT is really the non-bindable moniker.
With best wishes,
Vita
|
|
|
|