|
That's like saying "No car can go faster than 200 km/h".
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
Jörgen Sigvardsson wrote:
That's like saying "No car can go faster than 200 km/h".
Brilliant observation! A thousand pardons.
VB Script and JavaScript (the scripts mentioned by the original poster as being pertinant) do not support structures.
Robert
|
|
|
|
|
I saw the references to VBScript and JavaScript after I posted my reply. I knew then that you meant only those script languages.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
You may have to use safe arrays for this.
« Superman »
|
|
|
|
|
Hi Imtiaz ,
Refer to this article from MS-MSDN.
Building ActiveX Controls for Microsoft Windows Using the Active Template
Library
This article is talking about something, which you are looking for.
As far as VB is concern, it must work !
I dont have much idea about scripting languages
This might ease your difficulties !
Cheers,
Vishal
|
|
|
|
|
Dear Friend,
I tried my best but i was unable to find the article you mentioned. MSDN search is giving me tons of result while i search the topic you mentioned.
Can you please give me the link of this topic.
Thanks
Imtiaz
|
|
|
|
|
|
I need the realization of [b] _variant_t(TEXT("a")) on MASM. [/b]
Or any kind of [b] _variant_t() [/b]
Also I need [b]_bstr_t(urllink) [/b]
Please help if you can!
|
|
|
|
|
Hi
I want to use the MSRdp (Microsoft Remote Desktop control) control from VC windows application but i dont want the control to be visible i want to create it programmatically. i used CoCreateInstance all things goes right and all the functions return S_OK but it doesnot get the session created on server however when i put the MSRdp control on the dialog box and use the same code from there it get connected .... and session is also created on server... Plz reply ASAP
this is the code i used for it
IID IID_RDP =
{0x9059f30f,0x4eb1,0x4bd2,{0x9F ,0xDC,0x36, 0xF4,0x3a, 0x21,0x8F, 0x4A}};
void Connect()
{
::CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);
DISPID dispid =0;
IDispatch* pDisp = NULL;
CString text;
GetDlgItemText(IDC_SERVER,text);
HRESULT hr;
hr = ::CoCreateInstance(IID_RDP,NULL,CLSCTX_SERVER ,IID_IDispatch,(void **)&pDisp);
pDisp->AddRef();
//Setting Username and server
SetProperty(pDisp,OLESTR("Server"),(OLECHAR *)text.AllocSysString());
GetDlgItemText(IDC_USER,text);
SetProperty(pDisp,OLESTR("UserName"),(OLECHAR *)text.AllocSysString());
SetProperty(pDisp,OLESTR("Domain"),(OLECHAR *)"");
//setting password
DISPPARAMS dispparams;
EXCEPINFO escep;
UINT uArgErr =0;
VARIANT Result;
::VariantInit(&Result);
Result.vt =VT_DISPATCH;
dispparams.cArgs = 0;
dispparams.rgvarg = NULL;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
OLECHAR *szMem=OLESTR("AdvancedSettings2");
hr = pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
IDispatch *pAdvanced = 0;
pAdvanced = Result.pdispVal;
pAdvanced->AddRef();
GetDlgItemText(IDC_PASSWORD,text);
SetProperty(pAdvanced,OLESTR("ClearTextPassword"),(OLECHAR*)text.AllocSysString());
hr =pAdvanced->Invoke(0x68,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
BOOL value = Result.boolVal;
//setting startup app
szMem=OLESTR("SecuredSettings");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr =pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYGET,&dispparams,&Result,&escep,&uArgErr);
IDispatch *pSecured = Result.pdispVal;
pSecured->AddRef();
SetProperty(pSecured,OLESTR("StartProgram"),OLESTR("explorer.exe"));
//connecting to server
szMem=OLESTR("Connect");
pDisp->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
hr = pDisp->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_METHOD,&dispparams,&Result,&escep,&uArgErr);
pSecured->Release();
pAdvanced->Release();
pDisp->Release();
return;
}
HRESULT SetProperty(IDispatch* pDispatch, OLECHAR* name , OLECHAR* value)
{
HRESULT hr;
VARIANTARG varg;
::VariantInit(&varg);
OLECHAR* szMem = name;
varg.vt = VT_BSTR;
varg.bstrVal = value;
DISPID dispidNamed = DISPID_PROPERTYPUT;
DISPID dispid;
DISPPARAMS dispparams;
dispparams.cArgs = 1;
dispparams.rgvarg = &varg;
dispparams.cNamedArgs = 1;
dispparams.rgdispidNamedArgs = &dispidNamed;
EXCEPINFO escep;
UINT uArgErr =0;
hr = pDispatch->GetIDsOfNames(IID_NULL,&szMem,1,::GetUserDefaultLCID(),&dispid);
if(SUCCEEDED(hr))
hr =pDispatch->Invoke(dispid,IID_NULL,::GetUserDefaultLCID(),
DISPATCH_PROPERTYPUT,&dispparams,NULL,&escep,&uArgErr);
return hr;
}
|
|
|
|
|
Hi,
can I get help on how to block and realse the ports for Win 98 OS. From msdn i found that ipseccmd is the utility that could be used for Windows XP and Windows2000 to block/release ports. Similraly, is there any utility available for Windows 98? Or is there any other method by which I can block/relase ports for Windows 98(i.e, any registry enry that helps in blocking ports)???????
Thnx in advance
Regards
Uthra
URagav
Everything can be sacrificed for truth, but truth cannot be sacrificed for anything .
|
|
|
|
|
Hello.... have solid, reliable code in C++ that automates Outlook. It has been around for a few years and 99.9% of my users report no problem.
However, occasionally a user reports that they get an error when CreateDispatch() is called. The code is 0x80004002 - No such interface supported.
Sometimes a repair or re-install of the Outlook installation fixes it, most times it does not, and those customers are just out of luck.
Any ideas what might be causing this problem? Of course I can't seem to duplicate it here....
Thanks!
Nicholas
|
|
|
|
|
Hello,
I'm receiving this very peculiar warning, after which my application crashes.
Warning: constructing COleException, scode = severity: SEVERITY_ERROR, facility: FACILITY_WIN32 ($800706BE).
I'm using Windows XP with SP2. The same application works fine on Windows 2000 SP4.
Googling didn't help at all... Hence posting this query here, just if anyone is aware of or has encountered this error and has some solution for the same.
Thanks,
Nirav
* Artificial intelligence is no match for natural stupidity! *
|
|
|
|
|
I think the 800706BE HRESULT code corresponds to
RPC_S_CALL_FAILED
Its defined in winerror.h
Search for this on google.. you might get something. I'll try and find some reason why its not working.
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi All,
Does anyone know of a MFC function equilivant to the OleRequestPendingTimeout function used in VB and V FoxPro? This is to prevent the "This action cannot be completed beause the 'file.doc -Micorsoft Word' program is not responding. Choose 'Switch To' and correct the problem" Message from appearing!
Thanks
|
|
|
|
|
I don't know the MFC functions, but I know that the VB which tells "This action..." uses the IMessageFilter interface.
With best wishes,
Vita
|
|
|
|
|
Hi!
I'm trying to implement a event that fires an UDT which contains another UDT. I have some doubts and questions. Here is the idl code:
typedef enum <br />
{<br />
S1_item1 = 0,<br />
}enumSample1;<br />
<br />
typedef enum <br />
{<br />
s2_item1 = 100,<br />
}enumSample2;<br />
<br />
typedef struct<br />
{<br />
BSTR m_string1;<br />
<br />
enumSample1 m_enum1;<br />
enumSample2 m_enum2;<br />
}st_NestedUDT;<br />
<br />
typedef enum<br />
{<br />
s3_item1 = -1,
s3_item2 = 0,<br />
}enumSample_3;
Q1: Is the s3_item1 ok? I read somewhere that enums are finally unsigned short.
typedef struct<br />
{<br />
enumSample_3 m_eS;<br />
<br />
}st_MainStruct
Q2: Should be the nested UDT member a VARIANT or just a st_NestedUDT member?
//------------------------------------------------------------------------
And the event is like:
[id(2), helpstring("method OnNewOrder")] HRESULT OnNewOrder(st_MainStruct stInfo);
And finally, how should I encapsulate the stInfo in order to call Invoke? My first thought was:
IRecordInfo * pRI;<br />
<br />
hr = GetRecordInfoFromGuids(LIBID_MyLibraryLib, 1, 0, 0, IID_st_Main_Struct, &pRI);<br />
if(FAILED(hr))<br />
return hr;<br />
<br />
CComVariant avarParams[1];<br />
avarParams[0].vt = VT_RECORD;<br />
avarParams[0].pvRecord = stInfo;<br />
avarParams[0].pRecInfo = pRI;<br />
<br />
CComVariant varResult;<br />
<br />
<br />
DISPPARAMS params = { avarParams, NULL, 1, 0 };<br />
hr = pConnection->Invoke(2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
Q3: Is that right?
Thank you in advance
Gizzo
|
|
|
|
|
Hello All,
I am new to COM world.
In COM is it possible to have a property with two parameters? For example:
GetValue(index, Value)
PutValue(index, Value)
Does COM allow this kind of definition in IDL file. What are pro and cons of this definition. If i declare a property with two paramters, how I will be able to use it in say C++?
Any one? Any idea?
Thanks in advance,
|
|
|
|
|
ckapil wrote:
In COM is it possible to have a property with two parameters?
Yes you can put it!
ckapil wrote:
Does COM allow this kind of definition in IDL file.
I am working on it,Will send you Source Code and Sample Application, if i am SuccessFul!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Good News for you!
i Successfully Created the Com Dll and Client Exe using double parameter Property!.
please send me your Email so that i send it to you!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
I am trying to update an ISequentialStream object in a RowSet in SQL Server. But am getting the following errors:
- Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
- String data, length mismatch
The "String data, length mismatch" one is troubling me. And I think it has something to do with the way I am creating the stream. This is the methodology I am trying to implement:
IStream *pIStream;
CreateStreamOnHGlobal(NULL, true, &pIStream);
pIStream->SetSize(x);
pIStream->Write(databuf, databuf_len, &byteswritten);
ISequentialStream *pISeqStream;
pIStream->QueryInterface(IID_ISequentialStream, (void **)&pISeqStream);
I am struggling with the length. As to what it should be set to. I have done a simple test to try and write a 6 character string. The size of the stream created is 6 bytes and I have set the size of the length in the bindings for the rowset to be 6. Yet I am getting a string length error on Update ...does a null terminator for the string have to be allowed for somewhere.
Any help on what I may be doing wrong here would be appreciated. Thanks.
|
|
|
|
|
If I do an GlobalAlloc and copy the data into this block of memory and pass that to the CreateStreamOnHGlobal function instead of using the IStream->Write function it works without an error.
But as far as I can tell, the size of the streams created using both methods are the same, and the memory allocated to each is the same.
|
|
|
|
|
I am trying to build a shared library (DLL) from m-File.The problem is that I need to use the graphics library.I know that I must bundle the libmwsglm.mlib library(using the command mcc) but I couldn't find how do it . Now I'm looking for a way to create a .dll (using graphics library)and after use it for example in C#.I think that somebody can help me and your help will be very useful for me.
Regards,
Marcel
|
|
|
|
|
Hi there,
I have built a COM component that makes available data from a device. The data is potentially confidential (commercially that is!), so I would like to limit the use of my component. Basically I want to only allow something else I have written to access its interfaces.
Can anyone give me an idea as to what the best solution for this is ...?
Apologies if this Q has been raised before, this is my first visit ...
Regards,
Rob.
|
|
|
|
|
Ok, I found out a way
I'll put it below in case anyon searching this place needs something similar. Thanks anyway ...
// In Server
// Define the license class - to be used by your ATL COM class
class CWrapperLicense
{
protected:
static BOOL VerifyLicenseKey(BSTR bstrKey)
{
CComBSTR inKey(bstrKey);
CComBSTR realKey(L"RobsHardcodedOneAndOnlyLicenseKey");
if (inKey == realKey)
return TRUE;
else
return FALSE;
};
static BOOL GetLicenseKey(DWORD dwReserved, BSTR* pBstrKey) {return FALSE;};
static BOOL IsLicenseValid() {return FALSE;};
};
// Add to your ATL COM class
DECLARE_CLASSFACTORY2(CWrapperLicense)
// This tells your class to implement the default interfaces for classfactory2
// These are then overridden in your CWrapperLicense
// In Client
CComPtr<IClassFactory2> spCF2;
CComPtr<IATLCOMClassDefinedInServer> spServerClass;
CoGetClassObject(CLSID_ATLCOMClassDefinedInServer,CLSCTX_INPROC_SERVER,0,IID_IClassFactory2,(void**)&spCF2);
spCF2->CreateInstanceLic(NULL,NULL,IID_IATLCOMClassDefinedInServer,L"RobsHardcodedOneAndOnlyLicenseKey",(void**) &spServerClass);
|
|
|
|
|