microsoft.public.dotnet.framework.interop Archive - May 2004
Post a message to this list
Messages
Page: 12345
Win32 Interop: Windows Installer SDK (2 replies)
microsoft.public.dotnet.framework.interop
I need to determine the ProductCode from msi (install file) using a .net application (web service) written in C#. I found a function in the Windows Installer SDK which seems to be what i want the function is defined as: UINT MsiOpenDatabase( LPCTSTR szDatabasePath, LPCTSTR szPersist, MSIHANDLE* phDatabase ); Mostly this isn't too tricky I defined an DLLInport for the function like: [DllImport("msi...
Retrieving LPCTSTR return from Native DLL (2 replies)
microsoft.public.dotnet.framework.interop
Hi All I have a third party unmanaged VC DLL that I am planning on using from within a C# application. I am having problems getting a particular function call into this DLL working. The function is declared as: extern "C" declspec(dllexport) LPCSTR cdecl GetPort(void) Can anybody tell me how I set up the DLLImport declaration for this function. I have tried setting it up to have a string return, a...
RasConnectionNotification and WaitForSingleObject Question (3 replies)
microsoft.public.dotnet.framework.interop
Hi I was going to use WinAPI's WaitForSingleObject to receive notification from RasConnectionNotification but I read that .NET has an equivillant method "WaitOne" in "System.Threading.AutoResetEvent". I don't know if the following code works or not, I didn't continue building it, because I want to do it using the .NET functionality by using the "RasConnectionNotification" WINAPI for example and th...
Will an IE Band written in c# work on all OS's ? (3 replies)
microsoft.public.dotnet.framework.interop
Hi. I am interested in developing an IE band (small toolbar with buttons, etc;) and I was thinking maybe write it in c#. will this band after building it work on all os ? like: 98, win2k, xp ? Thanks a lot in advance for any help. if you think I have to use c , let me know. Also, if someone have a nice starting point for writing IE toolbars with c#, I will be very thankful. Dave Reinhold.
CreateObject fails (2 replies)
microsoft.public.dotnet.framework.interop
On a W2K box with Framework 1.1 using VS03, I have a C/S app where the server contains managed code and the clients VC (unmanaged). Using .NET remoting. I register the managed code with regasm. This combination works perfect (also by cursomers) Now I would add a small ASP 3.0 app to the client, and in the asp I have the following code lines dim obj obj CreateObject("MyNamespace.MyClass1") On my de...
Problem: How to set a value to a property using IDispatch (4 replies)
microsoft.public.dotnet.framework.interop
Hi, I got a problem here and would appreciate some help. I have a System. ComObject. I would like to get/set properties of this COM object. I cast it to IDispatch, and using invoke() I'm able to get properties' values. Now I want to set a value, in order to do that, I need to set the field rgvarg of System.Runtime.InteropServices.DISPPARAMS structure with the value I want to set. The problem is th...
Problem: System.__ComObject recognition (9 replies)
microsoft.public.dotnet.framework.interop
Hello, I have a problem and would appreciate help very much. I have an application that receives instructions from a Windows script engine. When the windows script engine passes primitive types like string & int, I can get them successfuly, however, when it passes more complex structures, I get them as a System. ComObject and I cannot seem to do anything with this object. I know that the System. C...
COM Interop and DCOM (3 replies)
microsoft.public.dotnet.framework.interop
Hi all, is it possible to have a COM Object running in it's own process and being accessible via DCOM written in C# ? All I found in the MSDN seems to be about Inproc Servers. Best regards, Michael
Pascal calling convention (2 replies)
microsoft.public.dotnet.framework.interop
Hi Pascal calling convention is not directly supported. What do you do out there about this? No stack space is allocated for stdcall as caller function cleans up. Pascal convention requires that the there is space allocated for the return value. Use stdcall and then fiddle with the parameters? Help please! Emma Middlebrook
Register an Object in the ROT (3 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi I want to register an instance of an object in the Running Object Tabel, using either UCOMIRunningObjectTable.Register(), or the oleaut32.dll function RegisterActiveObject() like I did it in VB6. But both did not work. Can somebody of you tell me what is wrong with my C# code //C# public const long ACTIVEOBJECT STRONG 0; public const long ACTIVEOBJECT WEAK 1; [DllImport("ole32.dll", EntryPoint ...
struct(Net) to struct(COM) (3 replies)
microsoft.public.dotnet.framework.interop
Hi, I have a .Net Component (DirectShow Filter) which should be used from COM. COM orders a struct. struct myStruct { int a int b .... }; The COM call looks like: myStruct ms NULL; MyCPPMethod(&ms); Since I want to use a .Net Component I need a procedure which translate MyCPPMethod(myStruct **ms) in something what .Net understands. E.g. MyC#Method(out myStruct ms) This works only if myStruct! null...
Can't operate my Excel App on another Computer (2 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi, I wrote an excel application that reads an excel file with C#. It works on my computer ( W?n XP professional with Office 2002 with sp 2). Bu tWhen I make EXE file and copy the release directory to another computer ( Windows 2000 Professional with Office 2000 with sp 3 ) it doesnot work. The code is below and to each line I have put a messag box to obtain where it crahes. It crashes after the s...
Cusom exceptions and COM+ (4 replies, VIP)
microsoft.public.dotnet.framework.interop
I am having problems with custom exceptions in COM , I have read the article in MSDN (march 2004) and implemented the correct features.... The custom exception class derives of ApplicationException and also has the [Serializeable] attribute and has a Serialization constructor and overriden implementation of GetObjectData.... [Serializable] public class BaseException : System.ApplicationException, ...
Calling .Net Asem from VBScript (2 replies)
microsoft.public.dotnet.framework.interop
I have a .net assembly that i have comiled and successfully run regasm and gacutil on. I access the assembly through com in vb6 but i still get "ActiveX cannot create object" when running from VBScript. Anyone know what is going on?
Sharing Resource Files Between C# and C++, Possible? (3 replies)
microsoft.public.dotnet.framework.interop
I have a Managed C DLL used by a C# application. I'm building with VS .NET 2002. I have a resx file loaded with string data. The C# application can access the string data fine, like so: ResourceManager rm new ResourceManager("DS.Names", Assembly.GetExecutingAssembly()); String text rm.GetString("1"); Now in my Managed C DLL I want to do the same thing: ResourceManager* rm new ResourceManager("DS.N...
Interop and Garbage Collector (2 replies)
microsoft.public.dotnet.framework.interop
I have the following question. I have an unmanaged function in DLL with pointer parameter. For example something like FillMemory. In C# code I declare it: [DllImport( mydll.dll, CharSet CharSet.None )] private extern void FillMemory( byte[] arr, int size, byte fill ); Then I have two threads. The first thread calls FillMemory: byte[] arr new byte[ 4 ]; FillMemory( arr, 4, 1 ); The second thread ca...
Add COM+ Reference to C#.NET Assembly (2 replies)
microsoft.public.dotnet.framework.interop
I'm new to C#.NET and am building a windows service program. I have been given a COM component (also created with C#.NET), which I've registered on my local machine using RegSvcs. I am having difficulty adding a reference to this COM component in my project. In the Add Reference dialog, the component does not appear in the list. When I browse to the folder where the DLL and TLB files exist and sel...
Howto marshall LPTSTR? (4 replies)
microsoft.public.dotnet.framework.interop
I've been trying to PInvoke some of the Windows SmartCard API and haven't been able to get too far. The following function is posing my current problem.. LONG SCardListReaders( SCARDCONTEXT hContext, LPCTSTR mszGroups, LPTSTR mszReaders, LPDWORD pcchReaders ); If I supply null's for mszGroups and mszReaders I get back the required length for the mszReaders string in pcchReaders. This works, but wh...
Marshal a tree structure across threads? (2 replies)
microsoft.public.dotnet.framework.interop
Ouch. I've got a nasty problem here. I need to load a tree structure into a treeview from a database. I've just tested it with 10,000 items and its dog slow (one of the main reasons is because I am manually "filtering" the items with my own filtering structures). What I want to do is run a thread which constructs the TreeView (and nodes) so that the rest of the GUI remains responsive. Then, when t...
marshalling to VARIANT (2 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi, The matter is: I had a C function compiled in a Win32 DLL having this signature: short OP LoadApplication(short uLength,VARIANT varData) varData tipically cointains a SAFEARRAY of bytes (VT ARRAY|VT UI1). From my C# code I tried to import and use the C function, but at the end I wasn't able to do this. Could anyone help me? The code to use the function in C# is this: [DllImport("objproc.dll", ...
VB.Net application and needing to reference a VB6 COM Component ... (2 replies)
microsoft.public.dotnet.framework.interop
Hello Everyone, I have a .Net based application and I need to reference a COM object that was written in VB6. The VB6 COM objects strings and long integers as its parameters and returns a string of XML data. Can someone point me in the direction on how to add this COM component into my VB.Net application? Jeff Bishop Applications Systems Analyst, Principal CCIT, Distributed Applications Phone: 520...
Converting Array Data Types (2 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi, Are there any conversion methods available for converting Arrays of one data type to another,e.g I have an array of byte data type and I want to convert the array data to sbyte data type. Do, I need to convert every element individually through looping or is there any other mechanism ? byte[] contentBytes encoding.GetBytes(contentType); // Now byte[] needs to be converted into sbyte[] Regards,...
Regarding .NET Framework (2 replies)
microsoft.public.dotnet.framework.interop
1). Is .NEt framework different from runtime. do we need to give .net franework alongwith the application. 2). is .NETframework there on Longhorn 3). i have LOnghorn from MSDN but there it prompts to install .net framework alongwith. it is too heavy to be given alongwith installer Tarun ********************************************************************** Tarundeep Singh Kalra (tarundeep1976 nosp...
Role Based Security (3 replies)
microsoft.public.dotnet.framework.interop
Hi All, In my serviced component, I am unable to make security checks, because SecurityCallContext.IsSecurityEnabled returns false. This may be basic. But how do I turn on the security? Thanks, surya
Use IPersistStreamInit on a .NET control (3 replies, VIP)
microsoft.public.dotnet.framework.interop
Hi, I'm trying to save a bunch of .NET controls' states using IPersistStreamInit. IPerstreamInit.Save works for most controls, except System.Windows.Forms.Form. I get an IO exception 0x80131620. I read that Microsoft has done a complete testing with hosting .NET controls in an ActiveX container like MFC. Shouldn't this work? Thanks, dax
Ad
Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification