|
http://www.codeproject.com/useritems/msxmlcpp.asp
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
How to register com component
|
|
|
|
|
In command prompt:
regsvr32 filepath
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
from the command line
regsvr32 yourdll.dll
do unregister
regsvr32 yourdll.dll /u
though i like to have a batch file in my project which is run as a post link command
Bryce
sounds like we need a tool to do it from windows ?
|
|
|
|
|
Testing message
|
|
|
|
|
testing worked...isn't it great when that happens?
bryce
|
|
|
|
|
I have created a MSXML object as following C++ code shows:
CComPtr<ixmldomdocument> spXMLDOM;
HRESULT hr = spXMLDOM.CoCreateInstance(__uuidof(DOMDocument));
if ( FAILED(hr) ) throw "Unable to create XML parser object";
if ( spXMLDOM.p == NULL ) throw "Unable to create XML parser object";
CComBSTR str(L"<xmldata><xmlnode><xmltext>Hello, World!");
hr = spXMLDOM->loadXML(str, &bSuccess);
But it doesn't load the str and the value of bSuccess is FALSE
Please help.
Thanks in advance.
|
|
|
|
|
I want to output a recordset to client in COM, I did as following:
[id(7), helpstring("method GetStudentInfo")] HRESULT GetStudentInfo([in] BSTR bstrStudentID, [out,retval] _Recordset *pRs);
But error report that
error MIDL2025 : syntax error : expecting a type specification near "_Recordset"
But here i think _Recordset is a type specification
|
|
|
|
|
You can pass _RecordsetPtr also as a IDispatch*. For the _RecordsetPtr problem, lookup http://www.codeproject.com/atl/atl_ado.asp.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Hi
I want to run the sample "Simple" on remote machine.We can run as a local server or remote server.I am able to run as a local server but not able to run as remote machine.How to accomplish this?How to register the exe in DCOM?
plase help?
Thank you
Pathi
|
|
|
|
|
i do mine as an NT service
then run the exe with "/service"
eg. fromthe command line
"mynewdcom.exe /service"
bryce
|
|
|
|
|
Hi
I wrote a component and wanted to access it on remote machine.how to accomplish this?How can I register that component?Do I need to register that exe on both machines?Then How to register and call that component?(using DCOM)
Please help me
Thank you
Sai
|
|
|
|
|
run the exe as with "/service" onthe machine which you want to use as the server
you can connect to it (assuming you have the permissions set etc)
by using CoCreateInstanceEx
see the dcom articles here on codeproject
bryce
|
|
|
|
|
Hello all,
I'm using BeforeNavigate2 event to get the Post data as per MSDN article:
HOWTO: Handle Data from a Post Form When Hosting WebBrowser Control (Q256195)
But I'm unable to get the the BSTRs from the Post Data SAFEARRAY.
Here's my BHO's Invoke implementation:
if (dispidMember ==DISPID_BEFORENAVIGATE2)
{
if(pDispParams->rgvarg[1].vt==(VT_BYREF|VT_VARIANT) && pDispParams->rgvarg[2].vt ==(VT_BYREF|VT_VARIANT) && pDispParams->rgvarg[2].pvarVal->vt!=VT_EMPTY)
{
ATLTRACE("\nGetting POST Info");
CComBSTR szTemp,szPostData;
long plLbound, plUbound;
CComVariant varHeaders(*pDispParams->rgvarg[1].pvarVal);
varHeaders.ChangeType(VT_BSTR);
CString strHeaders(OLE2T(varHeaders.bstrVal));
//got the header data
CComVariant var(*pDispParams->rgvarg[2].pvarVal);
SAFEARRAY *psa=NULL;
psa= var.parray;
SafeArrayAccessData(psa , (LPVOID*)&szTemp);
//next two lines yields an Unhandled
//Exception when there is valid Post data??
// SafeArrayGetLBound(psa , 1, &plLbound);
// SafeArrayGetUBound(psa , 1, &plUbound);
CComBSTR str;
szTemp.CopyTo(&szPostData);
SafeArrayUnaccessData(psa);
ATLTRACE(OLE2T(szPostData));
//output always ""
}
}
Dunno what is going wrong. DO I need to preallocate a SAFEARRAY?
My Postdata html pages are nothing out-of-the-ordinary.Just a simple textbox that passes a string thru HTTP POST.
Any help will be great.
TIA.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
Can anyone point me towards the part of the Outlook object model, where I can find the number of new emails in a folder-
Regards
Ben
Vacancy for signature; Apply within.
|
|
|
|
|
Ben,
the microsoft knowledge base article Q171603 shows an example on how to get
the unread message count of an outlook folder. Hope this helps.
Alwin
|
|
|
|
|
I'm trying to return a COM object, example:
Object *po;
CreateInstance(&po);
void getObject(IUnknown *pVal)
{
pVal = po;
// OR I even tried this, but it does not work.
po->QueryInstance(pVal);
}
I get a NULL pointer at the calling method.
Thanks in advance.
Ken
|
|
|
|
|
I do not have enough information to answer your question. I don't really know what your question is.
Is Object *po; a global variable?
What is CreateInstance? Where is it called.
When you mention po->QueryInstance , do you mean QueryInterface?
If you can give me a little more information, I will try to help you.
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
As kilowatt said your code is not clear,but I know one thing,You have to type cast the IUnknown interface to your proper interface.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I have a function in my COM object, written on C++ Foo(int *retval1, int *retval2) . All I need now is to call this from VB. But something wrong goes here. VB says "ByRef type mismatch". What type of parameters should I have in my C++ function, to make it available for VB?
I need to return some values in those parameters. It is simple integers, but how to declare it?
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Just guess:
You don't need to change your C++ functions.In your VB code use CInt
this is from MSDN:
Dim MyDouble, MyInt
MyDouble = 2345.5678 ' MyDouble is a Double.
MyInt = CInt(MyDouble) ' MyInt contains 2346.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Yeah, found it too. The problem was *laughs* I dunno why, but VB treats Long and Integer as a different types, and int in C++ is actually Long in VB.... I'd say this is very strange, don't see any logic, lol
Philip Patrick
Web-site: www.saintopatrick.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Hi, Mazdak:
I am still some confused about how to access object from other objects.
For example, I want to biuld two objects, one is used to access database ( some private variables such as _connentionPtr _CommandPtr were used), another used to implement rules. But how to realize it. How to pass pointer such as _ConnectionPtr, _CommandPtr from data access object to rules realization object.
If you are convinient, can you send me some examples by email. I am a new learner and find it is very difficult to find such exmaples in website.
Thank you very much for your consideration.
Qiang
|
|
|
|
|
chq12 wrote:
another used to implement rules. But how to realize it.
Sorry,what do you mean by rules?
I have sample code that work with ADO objects in a COM object,and pass from client to server.Yuo can tell me your email to send it for you.
If you want to use first COM object in second one use CreateInstance() in the Method you to use it and create first object in second one and here you can access to Methods and properties of first object.Imagine second COM object as a simple client application and first one is a regular COM onject.
You can pass _ConnectionPtr,_CommandPtr as parameter I don't THINK there is limitation for it,whats your problem for that?
Again use CreateInstance() to initialize them and pass it to COM object.In my application I pass strings to COM object and use those strings for _ConnectionPtr or _CommandPtr ,I think this really safer and better than passig the _ConnectionPtr and _CommandPtr themselves. I think its waste time and codes to create two object and use one for only pass those objects,you can pass simple strings and use them in one object.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
Thanks, Mazdak. I think I can use parameter to transfer _ConnectionPtr and _CommandPtr. I want to this because i want to create a database access object which including method to get conncetion with database and some common used method such as create a parameter,then other objects can access it to get connection with database. So it is much easier to extend program and mantain it.
My email address is: dav258@hotmail.com, I am a new learner and want to get some examples. if you are convinent, please send me your sample code to me.
Thanks again.
Qiang
|
|
|
|