|
How to use executable(exe) and service exe with the client?
Is it same as using Dll with client?
Any sample links please?
Thanks
Row
-- modified at 8:02 Tuesday 20th June, 2006
|
|
|
|
|
I have a win32 library with no interfaces , just only exported functions.
e.g. One of those is .. bool getInfo (char *string, int counter);
I created a ATL exe , inserted a simple object.No I want to link the above library to my ATL project.
So in Project->settings->link, I gave the lib name and directory of the lib file.
Now I want to use this function getInfo in my atl program.
SO I added one method in my interface say CallLibFunction
And in that method I want to call getInfo..
Are these steps ok?
Row
|
|
|
|
|
Row wrote: Are these steps ok?
Yes,
These are the correct steps to add the library into project.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi All
I wonder about the reason that after create and use some com pointer ( Smart pointer ) why we must call delete of the current pointer ?
I know that the reason is to save memory - but if we does not delete the pointer the application will be crash and not have only leak of memory.
So some one can tell me why the application will crash in case we did not delete the pointer ??
Thanks for any help.
-- modified at 23:37 Monday 19th June, 2006
|
|
|
|
|
You don't use delete on a COM smart pointer, you call its Release() method if you need to manually release the interface. Although, you would usually let the destructor do that for you (that is, after all, the main reason for using the smart pointer in the first place).
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
I'm trying to create a .dll using ATL, which I want use in C#.
Can anybody please guide me to create a simple method / function which takes string in input parameters and returns the same(string)..
I tried a lot but always faced problem of returing string back to calling function in C#.
I did the same with C++ class library successfully but when it comes to ATL its not the same.
As I'm using other SDK API's in creation of .dll and I can't go with Class Library its having problem with "CLR and MTd". Which can't go together. Finally I decided to stick to ATL.
Now please guide me to create the methods which I can use in C# to get the string value.
Arun
|
|
|
|
|
IDL defenition will be:
[id(1), helpstring("your atl method signature")] HRESULT YourATLMethod( [out,retval] BSTR* ReturnString);
and the C++ implimentation signature will be:
STDMETHODIMP CYourClass::YourATLMethod(BSTR* ReturnString)<br />
{<br />
_bstr_t bstrReturnstring = _T("some string here");<br />
*ReturnString = bstrReturnstring ;<br />
return S_OK;<br />
}
cheers..milton kb.
|
|
|
|
|
I want help on following.
I want to store properties for .doc,.xls,.ppt,.txt files. I used IStorage and IStream interfaces to store properties in the said files. It works well with .xls and .txt (on NTFS file system) files but not with .doc and .ppt files. I can write to files, and I can retrive the stored properties again successfully. But if I modify .doc or .ppt files using their editors (MsWord and MsPowerPoint respectively), properties only I had written appeared vanished, i.e. while next read from program fails for these properties (Properties written from Interface provided by Windows retain very well).
I tried IPropertySetStorage+IPropertyStorage also, but result is same.
I tried to write SummaryInformation,DocumentSummaryInformation storages.
I tried to write my own storages also. Userdefined storage retains this but these properties can be seen and modified from Windows user interface of properties for these files so I don't want to use it.
I am using C/C++ and WIN32 APIs.
Can any one help me on this plz.
First deserve then desire. Let be deserved first.
|
|
|
|
|
how could we use DTs in my vb.net code it always give me the following error
"13 query interface for customDTS.customtask dll"
plz reply me ?
|
|
|
|
|
[Was asked in the VC++ board earlier today, but got no replies...]
OK... I am working with an IDispatch -based interface that needs to be completely automation capable (i.e. uses the Typelib Marshaller - no custom marshalling).
Now, AFAICT:
o I can pass structures over an IDispatch -based interface as the structures consist solely of automation-capable types
o I can pass arrays of automation-capable types over IDispatch -based interfaces using SAFEARRAY (possibly wrapped within a VARIANT )
(For now, ignore the fact that some clients, like VBScript , may be unable to handle these kinds of parameters.)
However, I cannot seem to find information telling me that both are possible at the same time. IOW, I want to pass an array of structures across an IDispatch -based interface. The only information I can find regarding passing arrays of structures indicates that I will have to serialize the data to a byte stream and then send the raw bytes over the wire wrapped in a SAFEARRAY of VT_I1 types.
While I am sure I can make that work, and can provide clients with information on how to decode the structures, this feels kinda 16-bit-ish to me, and not just a little quick-n-dirty.
So, does anyone know if it is possible to pass arrays of structures over IDispatch-based interfaces, or do I have to do the byte-stream route? If so, please point me to the relevant documentation.
Adva[Thanks]nce! (Cheesy, I know... )
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I think its not possible without custom marshalling. You have to send these as byte arrays i.e., SafeArray of UI1 (VT_ARRAY|VT_UI1). I ran into some problem a little while earlier and I couldnt find any other way to do this.
I will be happy to take my words back if someone can point to anyother possible solution.
"Watching non-programmers trying to run software companies is like watching someone who doesn't know how to surf trying to surf."
|
|
|
|
|
Hello Aamir,
I've written a sample COM application that I believe will demonstrate what James needs. If you are interested, pls email me directly :
bio_lim_2004@yahoo.com
I'll send it to you too.
Best Regards,
Bio.
|
|
|
|
|
Hello James,
I've written a sample COM application that I believe will demonstrate what you need. Pls email me directly :
bio_lim_2004@yahoo.com
I'll send it to you.
Best Regards,
Bio.
|
|
|
|
|
Before asking questions about CoRegisterClassObject, I want to give an idea of what I am trying to do. The purpose of my project is to capture all XMLHTTPRequest calls from Internet Explorer through an external application (the application I am developing) and record the data sent and responseText for debugging purpose. With some ideas from the MSDN forum, I built my class object which implements IClassFactory and IXMLHTTPRequest and I used CoRegisterClassObject to register and associate CLSID_XMLHTTP with my own object. (the CLSID of class XMLHTTP which implements IXMLHTTPRequest and any script in IE making XMLHTTPRequest should go through this class). However, the CreateInstance of IClassFactory I inherited never got call when the AJAX web application is obviously making XMLHTTPRequest.
I read an article saying that CoRegisterClassObject is only effective if it is in the same apartment of the thread making calls to the class object you are overriding. Here is the link:
http://66.102.7.104/search?q=cache:6BaNPZeQ3e4J:discuss.microsoft.com/SCRIPTS/WA-MSD.EXE%3FA2%3Dind9911a%26L%3Ddcom%26T%3D0%26P%3D13080+CoRegisterClassObject+override&hl=en&gl=us&ct=clnk&cd=3[^]
Is it the cause of not working? What apartment is Internet Explorer and is it feasible to execute CoRegisterClassObject in every apartment IE is in? Please advice.Thanks
Paulino
|
|
|
|
|
Hi,
I am tring to import Excel COM (Microsoft Excel 9.0 Object Liblary) to a .NET2.0 poroject's references and it dose not work. I receive errors about wrong assembly. I tried this under .Net1.1 and it worked. Dose it mean that this standart COM is not suported in .Net2.0? Did anybody have a problem like this?
Thanks in advance
Vizmunt
|
|
|
|
|
Hi,
I have some problem with this fn.
IMultiMediastream::GetDuration(..);
but this fn. worked well
IMultiMediastream::SetState(STREAMSTATE_RUN);
how to solve this problem
|
|
|
|
|
Error description?
"Watching non-programmers trying to run software companies is like watching someone who doesn't know how to surf trying to surf."
|
|
|
|
|
thankx for ur replay
now its working well
|
|
|
|
|
hi everyone, I have an old application VB6 and ASP.
the asp pages are on the webserver, the dll is registered on the webserver (win 2000), the dll is in the com+ also of the application server (win 2000). everything is working correctly.
When we change the webserver to a win 2003 server, I should register the com object on this new server, I made export from the application server, and I register this com on the new web server (win 2003).
I had this error: server.createobject failed.
it is like asp can't create any object.
what is the problem? security or configuration?
|
|
|
|
|
Can you specify the exact error which you are getting.
This most probably seems to be a security issue. There is a group called "Distributed COM Users" in the Groups. To use a COM Component from another machine through DCOM, user should be in this group. This group was not present with the original version of Windows 2003. It came only with SP1 of Win2k3.
Anyway, look at the exact error. It might be something else.
Tribute to Shog:
New CPhog is amazing especially with message posting, very well done Sir.
|
|
|
|
|
I'm writing Browser Helper Object (IExplorer plug-in) in C#, Microsoft VS 2005, Framwork 2.0.
1. I implement interface IObjectWithSite and add event handler for events SHDocVw.DWebBrowserEvents2_Event.DocumentComplete and SHDocVw.DWebBrowserEvents2_Event.OnQuit in function SetSite :
[System.Runtime.InteropServices.ComImport, System.Runtime.InteropServices.Guid( "FC4801A3-2BA9-11CF-A229-00AA003D7352" ), System.Runtime.InteropServices.InterfaceType( System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown )]
public interface IObjectWithSite
{
void SetSite( [System.Runtime.InteropServices.In, System.Runtime.InteropServices.MarshalAs( System.Runtime.InteropServices.UnmanagedType.IUnknown )] object pUnkSite );
void GetSite( [System.Runtime.InteropServices.In] ref System.Guid riid, [System.Runtime.InteropServices.Out] System.IntPtr ppvSite );
}
[System.Runtime.InteropServices.ComVisible( true ), System.Runtime.InteropServices.Guid( "C06B3B91-769A-42d5-8BCD-CF70F8589FBA" ), System.Runtime.InteropServices.ClassInterface( System.Runtime.InteropServices.ClassInterfaceType.None )]
public class DOMPeek : IObjectWithSite
{
void IObjectWithSite.SetSite( object pUnkSite )
{
if(m_IUnkSite != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject( m_IUnkSite );
}
m_IUnkSite = pUnkSite;
try
{
SHDocVw.DWebBrowserEvents2_Event WebBrowserEvents = (SHDocVw.DWebBrowserEvents2_Event)m_IUnkSite;
WebBrowserEvents.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler( OnDocumentComplete );
WebBrowserEvents.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler( OnQuit );
}
catch // cast or no such interface exception
{
}
return;
}
void IObjectWithSite.GetSite( ref System.Guid riid, System.IntPtr ppvSite )
{
}
2. Implement event handlers OnQuit and DocumentComplete
void OnQuit()
{
System.Windows.Forms.MessageBox.Show( "OnQuit" );
}
void OnDocumentComplete( object pDispatch, ref object VariantURL )
{
System.Windows.Forms.MessageBox.Show( "OnDocumentComplete : " + VariantURL );
}
3. I register the object DOMPeek as Browser Helper Object in windows register.
Then I run IExplorer and see the messageBox "OnDocumentComplete : about:blank". Then I close IE window and see the messageBox "OnQuite".
The problem consist in that I take this result only in MSWindosw2003sp1 (server) with MS VS2005 installed. In MSWindowsXPsp2 without any updates, without MS VS2005, but with all Framework installed I didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". What's problem??? What updates need for correct working in MSWindowsXPsp2???
Then I try to install all updates for MSWindowsXPsp2 from Microsoft site and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Then I try to install MS VS2005 but didn't install all updates for MSWindowsXPsp2 and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Finally I install all updates for MSWindowsXPsp2 from microsoft site and then MS VS2005 then I see the messageBox "OnDocumentComplete : about:blank" and "OnQuit". But if I install MS VS2005 and then all updates for MSWindowsXPsp2 then not woking (didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit").
What's problem??? What specifically updates need for correct working in MSWindowsXPsp2???
|
|
|
|
|
Hello,
I have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
Thank you,
Agnes
|
|
|
|
|
athomass wrote: have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
You have to read the bytes of the BITMAP and send that bytes,After receiving total bytes prepare the bitmap from that bytes of the BITMAP
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello,
What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
|
|
|
|
|
athomass wrote: What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
Use just read the bitmap into byte array and simply send it ,not necessary to convert it from bytes to VARIANT with pbstrVal or a SAFEARRAY
because in send API it is typecasted into const void*
Knock out 't' from can't,
You can if you think you can
|
|
|
|