|
I encountered one access denied problem with the DCOM in Windows XP Sp2.
I have two COM servers. One say, X is service and another say, Y is an EXE.
I wrote one client application say, Client for Invoke X.
The Client will invoke the Service X (which are running in the same machine).It work successfuly.
The Service X will invoke the COM EXE,which is running in another machine.It will not work.
shibu george
|
|
|
|
|
check the firewall settings.
hello
|
|
|
|
|
Hi,
I have disabled the Firewall. Set the define the DCOM Remote Access and Remote Launch permissions.But the issue is still the same.
Thanks
Shibu George
Shibu George
|
|
|
|
|
What do you get in the event log on either machine when it fails?
(and you did remember to register any proxy/stub DLL's, didn't you...)
|
|
|
|
|
Hello all,
I have an Activex Control in vc++ 6.0.It is a player plays cam files.
I have designed in the way that everytime the Activex control opens ,cam file will be downloaded from the server(Download Dialog) and after downloading the download dialog is closed automatically using OnThreadFinished.
LRESULT CHttpDownloadDlg::OnThreadFinished(WPARAM wParam, LPARAM /*lParam*/)
{
m_bSafeToClose = TRUE;
m_ctrlAnimate.Stop();
if (m_bAbort)
EndDialog(IDCANCEL);
else if (wParam)
{
AfxMessageBox(m_sError);
EndDialog(IDCANCEL);
}
else
EndDialog(IDOK);
return 0L;
}
OnThreadFinished is for closing the dialog after the cam file downloads
fully.
1.Is ther any method to close the dialog while downloading the file.
Help me please and give me ur suggestions.
thanks in advance
Sunita
|
|
|
|
|
hi ,
what is the meaning of #pragma pack ?
From MSDN I came to know that it specifies the packing alignment for structure and union members .
But what is meant by packing alignment ?
Can you please tell me.
Thanks in advance
|
|
|
|
|
If you declare a struct with
char dummy;
short x;
long y;
members, the "optimal" size would be 1 + 2 + 4 (assume x86 for the moment).
However, this would be with alignment of 1. This says what byte boundary you use for packing. With an alignment of 2, each member begins on the next available 2 byte boundary, so the single char would be followed by an unnamed pad byte, the short would already be aligned correctly, as would the long.
Similarly with 4 byte, the char is followed by 3 unnamed pad bytes, the short by another two, and the long would be OK as is.
I can almost hear you asking "Why would I want to waste memory like that?"
[fx: pause for reader to actually ask...]
It's all to do with the way the processor accesses memory, and for some CPUs, like the SPARC, trying to access a packed (1) long would cause an exception.
The important thing is to consistently use the same alignment for all in memory versions of a structure. For instance, if you build a DLL with a function that takes a structure, the declaration of that structure should really include
#pragma pack(push)
#pragma pack(n)
struct {
....
};
#pragma pack(pop)
so that irrespective of the compile time options elsewhere, it has the packing n (where n is a power of 2). Without this, you might build the DLL with pack(2), for instance, and a client might be built with pack(1). This would misalign the data, and might even result in an access violation when you call the DLL function.
Does that help?
Steve S
Developer for hire
|
|
|
|
|
Thank you very much for your reply
|
|
|
|
|
Hi.
I'm developing MFC Activex library, which deals with data from MS Access DB. I need to make function like
short GetTagStruct(short nTag, VARIANT *arrayTagStruct) - .odl file in vc6++
I want to call this interface function in VB.
Structure can be for example:
<br />
Public Type TagStruct<br />
sTagName As String<br />
x As Single<br />
y As Single<br />
sObjName As String<br />
sDispPath As String<br />
sDispName As String<br />
End Type<br />
I know how to handle BSTR array in Variant, but I don't know what type I should select for safearray of user defined structure. For BSTR it is VT_ARRAY | VT_BSTR.
Can you give me example of using safearray of user defined structure stored variant ?
Thanx.
rudo
|
|
|
|
|
The Variant type used for this VT_ARRAY | VT_UI1 means a SafeArray of Unsigned Bytes. Which further means that this is simple binary data which you are storing in a variant.
"Some people believe football is a matter of life and death.
I'm very disappointed with that attitude.
I can assure you it is much, much more important than that. -- Bill Shankly"
|
|
|
|
|
Hi,
You can use VT_RECORD, if you define your structure as a UDT (user defined data type). See the MSDN for details on this topic.
Regards,
Tim
|
|
|
|
|
I can't write using Excel=Microsoft.Office.Interop.Excel namespace my .NET editor. What can I do for this problem. I am using Office 2003 and I added Microsoft.Excel 11 Object Library and Microsoft Office 11 Object Librry.
For your answers tnahk you ....
This is my sign
|
|
|
|
|
Hi All,
Im writing a dll in ATL COM called by a vb.net client. the client passes a 2d integer array when it calls MyMethod.
i have tow problems
I. i have trouble accessing the values in the array passed, i get junk values. this is the code.
<br />
STDMETHODIMP ExposedATLClass::MyMethod(SAFEARRAY **psa)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState())<br />
long arrlengthx,arrlengthy;<br />
long **myarray;<br />
int indexx,indexy;<br />
try<br />
{<br />
arrlengthx=(*psa)->rgsabound[0].cElements;<br />
arrlengthy=(*psa)->rgsabound[1].cElements;<br />
myarray=(long**)malloc(arrlengthx*sizeof(long**)); <br />
for(long tempvar=0;tempvar<=arrlengthx;tempvar++)<br />
{<br />
myarray[tempvar]=(long*)malloc(arrlengthy*sizeof(long*));<br />
}<br />
SafeArrayAccessData(*psa,(void**)myarray);
char details[100];<br />
for(int tempx=0; tempx<=arrlengthx; tempx++, indexx++, indexy=0)<br />
{<br />
for(double tempy=0; tempy<=arrlengthy; tempy++, indexy++)<br />
{<br />
sprintf(details,"%d %d %d",indexx,indexy,myarray[indexx][indexy]);<br />
this->Error_Logger(details);
}<br />
}<br />
}<br />
catch(CException ex)<br />
{<br />
char error[300];<br />
ex.GetErrorMessage(error,300);<br />
this->Error_Logger(error);<br />
ex.Delete();<br />
}<br />
return S_OK;<br />
}<br />
in the program
SafeArrayAccessData(*psa,(void**)myarray); returns success
other methods i've used to access data are (replace the line "SafeArrayAccessData(*psa,(void**)myarray);" with code below )
1. using SafeArrayGetElement
<br />
long ai[2]={0,0}<br />
for(int temx=0;temx<=arrlengthx;temx++,ai[0]++)<br />
{<br />
for(int temy=0;temy<=arrlengthy;temy++,ai[1]++)<br />
{<br />
SafeArrayGetElement(*psa,ai,&myarray[temx][temy]);<br />
}<br />
}<br />
here SafeArrayGetElement(*psa,ai,&myarray[temx][temy]); returns index out of bounds
2. using safearraylock/unlock
<br />
<br />
both lock and unlock returned success
all methods return this junk value for myarray[indexx][indexy] -842150451
the values of indexx and indexy are correct and so are the boundaries.
II. my other problem.. no exception is logged.
where am i wrong. pls help
Thanks in advance
Nikhil
|
|
|
|
|
Hi,
I want to Change GUID, Which generated by vc++, First I want to delete that GUID and Than want to set new GUID.
Thanks in Adv.
Regards,
RRRB
-- modified at 7:17 Thursday 20th July, 2006
|
|
|
|
|
Hi,
you can use GUIDGEN.exe
this should be present in the visual studio folder.
regards
nikhil
|
|
|
|
|
Thanks ,But First I want to delete the GUID Which is generated by vc++, After that I want to set my own guid for the same.
Looking forward....
|
|
|
|
|
u can use GuidGen tool which ships with visual studio and replace it in the idl file.
-- modified at 9:09 Wednesday 26th July, 2006
|
|
|
|
|
I have a componant and its idl file. I have included its header file in my stdafx.h and added the .c file into my project with addtoproject file. Actually that .c file containd actual definition of all IIDs and CLSIDs. Now its showing error. End file while looking for precompiled header. What to do now. Actually i dont have a clear idea how to use the classes defined in that componant.
Please tell me how to do that.
KIRAN PINJARLA
-- modified at 3:41 Thursday 20th July, 2006
|
|
|
|
|
I can help you with the first error;
You need to alter your project settings for the .c file so that it specifies "Not using precompiled headers".
If you're using VC6, you can right-click on file in FileView and select settings, you need C++ tab, category 'precompiled headers'. HINT: change it for 'All configurations' or you'll forget later!
Can't tell you how toi use the classes, since I have no idea what component you have. General stuff though :-
Make sure that you call either OleInitialize (or AfxOleInit if it's an MFC app) or CoInitialize/CoInitializeEx, or you won't be able to do anything.
To get an interface to an instance of the component, you need to call
CoCreateInstance( CLSID_xxxxx, NULL, CLSCTX_ALL, IID_zzzzzz, reinterpret_cast<void**>(&ptr));
where you have IMyInterface* ptr;
Check your return codes, and of course, if that works, eventually you'll need to call
ptr->Release();
Enjoy
Steve S
Developer for hire
|
|
|
|
|
Thank you Steve.It worked. I will try to use that componant and if got struck I hope u r there to help.
Thank You
KIRAN PINJARLA
|
|
|
|
|
i need to add Flexgrid in the ActiveX component is this posible how?
chetan
-- modified at 1:59 Thursday 20th July, 2006
|
|
|
|
|
try creating a composite dialog in activex.
-Prakash
|
|
|
|
|
//IDispatch wrapper class(es)
// .h file
class CAPI : public CWnd
{
public:
CString Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId);
}
// .cpp file function
CString CAPI::Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId)
{
//username = wwtest2;
//Password = RD9234;
//Userid = wwtest2;
CString result;
static BYTE parms[] =VTS_BSTR VTS_BSTR VTS_BSTR;
InvokeHelper(0x2, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,UserName, Password, UserId);
return result;
}
"God helps to whom who helps other"
|
|
|
|
|
If any body has used Netmeeting sdk please reply
I need help.
thank you
KIRAN PINJARLA
|
|
|
|
|
Actually Netmeeting COM has an Interface INmManager. I want to use it. and teh header file given for that is inmconf2.idl. If i am includeing using #include <inmconf2.idl> i am getting errors and its showing errors in idl file.
How to debug it
Please help me
KIRAN PINJARLA
|
|
|
|
|