microsoft.public.dotnet.framework.interop Archive - May 2002
Post a message to this list
Messages
Page: 123
A ref or out argument must be an lvalue (3 replies)
microsoft.public.dotnet.framework.interop
Hi Anyone know why the above compile error occurs? The situation is as follows: VB6: Public Property Let Celsius(NewTemperature As Double) mdblCelsius NewTemperature mdblFahrenheit ((NewTemperature * 9) / 5) 32 If mdblCelsius 0 Then RaiseEvent BelowFreezing End If If mdblCelsius 100 Then RaiseEvent AboveBoiling End If End Property C#: obj.set Celsius(ref Convert.ToDouble(txtCelsius.Text)); And the...
Extended MAPI from C# (5 replies)
microsoft.public.dotnet.framework.interop
I am working on a project in C# that needs to be able to send messages, insert tasks and calendar items and so forth into Outlook. I have been using the Outlook object model to accomplish this, but I would really like to keep the user from seeing all the security dialogs that pop up. I know that I need to use Extended MAPI to do this, but I am not a C developer so I am unsure of how to do it. I tr...
Help getting MSHTML to run under .NET (4 replies)
microsoft.public.dotnet.framework.interop
Hello, I'm trying to use MSHTML to load an HTML document from across the web into an IHTMLDocument2 (HTMLDocument class under .NET) object and sink the readyStateChange event to know when it is loaded. I've done this a hundred times from script but under .NET its very problematic. I am unable to get the event to fire, or the document to seem to load anything. Here is my code (simplified): using ms...
Calling C DLL from .NET problem: @ in string causes error (2 replies)
microsoft.public.dotnet.framework.interop
Hi, Anyone had a similar experience? I have been calling an C DLL which has an entry point called dmAPIGet using the following definition. [DllImport(@"C:\Program Files\Documentum\Shared\dmcl40.dll", EntryPoint "dmAPIGet")] private extern static string dmclGet(string cmd); Everything works fine I can call the function and it will work 99% of the time. But when a string containing @ is returned, BA...
Catching COM events in C# (2 replies)
microsoft.public.dotnet.framework.interop
Hi all, I'm quite new to .NET and C#, so this might be a silly question . . . but please bare with me. I am using the Microsoft Outlook 9.0 Object Library in a C# windows application. I have added it as a reference and am trying to catch the NewMail event of the Outlook.Application class. Code looks something like: // pre public class MainForm : System.Windows.Forms.Form { private Outlook.NameSpac...
Com Objects (2 replies)
microsoft.public.dotnet.framework.interop
how do I raise the events that lay in COM Objects created in other languages. I have a MSN COM exe server that exposes various events. In C# I have referenced the object and can access the objects properties and methods but cannot see a way of accessing the events. Please see the whole code below Thanks // START CODE SNIPPET using MessengerAPI; private void Form1 Load(object sender, System.EventAr...
Extending Active Directory Schema (2 replies)
microsoft.public.dotnet.framework.interop
I would like to modify the Active Directory schema. Does anyone know of effective sample code or instruction to accomplish this with .NET? Basically, I need to do two things 1. Create custom properties (or modify the existing custom properties already defined) on the 'user' schema and elsewhere in Active Directory. 2. Create new nodes with custom properties on the 'user' schema and elsewhere in Ac...
MSCORLIB Error 8004e003 (2 replies)
microsoft.public.dotnet.framework.interop
Hi, I have two COM components registered under Component Services. Both using ContextUtil.SetAbort and ContextUtil.SetComplete for transaction commit or transaction rollback. This is how the process be ... 1) ASP page calling Component A 2) Component A calling Component B 3) Component A calling Component B, ERROR When Component A calling Component B, an below error message is displayed on my brows...
Sorry RAS again :-( RasEnumEntries() doesn't works?! (3 replies)
microsoft.public.dotnet.framework.interop
Hi Sorry, but a new problem with the RAS API is appeared. The function RasEnumEntries() returns 603 ERROR BUFFER TOO SMALL. /* typedef struct RASENTRYNAME { DWORD dwSize; TCHAR szEntryName[RAS MaxEntryName 1]; #if (WINVER 0x500) DWORD dwFlags; TCHAR szPhonebookPath[MAX PATH 1]; #endif } RASENTRYNAME; */ [StructLayout(LayoutKind.Sequential, CharSet CharSet.Auto)] public struct RASENTRYNAME { public...
Permission denied amongst other things. (6 replies)
microsoft.public.dotnet.framework.interop
Deploying a .NET web application that utilizes some legacy COM object running in a package in COM Application works on server it was developed on. Deploying application has been a pain, despite the fact that the COM object is registered identically on the new server, the project paths are different, in this case Original D:\ New server is C:\ Think I managed to get all the references to work now, ...
activex control container in an asp.net application? (2 replies)
microsoft.public.dotnet.framework.interop
I have an activex control that I need to use to do some data processing but I need to do it in an asp.net application. I know that a winform application dialog can be used as an iolecontrolsite... but I don't know how to host an activex control (or what to use as a container in an asp.net application) any ideas? thanks in advance, gene
Bug? impersonation & directory services (5 replies)
microsoft.public.dotnet.framework.interop
I didn't get a response in the aspnet security discussion and I think the issue I am experience is related to interop (since directory services is accessed through COM apparently) so I am trying this here. An ASP.NET application is access by windows nt users (IIS using Windows Integrated Security). In testing, I log in as MYDOMAIN\MyUserName to the site. The asp is of course running as localmachin...
Parsing a structure through IntPtr (2 replies)
microsoft.public.dotnet.framework.interop
Hi, got the following problem IntSpriteEngine.Draw(IntTex, New IntPtr(0), EinsVector2, NullVector2, 0, Position, &HFFFFFFFF) is a call into a DirectX function through VB typelib. The probem is that I have to parse a DxVBLibA.RECT instead of the New IntPtr(0) in my application (or get an IntPtr to the DxVBLibA.RECT). Could anybody give me a hint about how to do this? Actually this problem is everyw...
PInvoke declaration help (3 replies)
microsoft.public.dotnet.framework.interop
Hi, Can some one tell me what the exact extern declaration should be for this API for use in C#: THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT RECT *pRect); the issue being the 5th parameter. I tried this, but got a 0x80004003 result from the API. Tried several other types but couldn't succede. Any help will be appreciated. [DllImport("uxtheme.dll", CharSet CharS...
Is there built-in way to set username and password of a windows service (3 replies)
microsoft.public.dotnet.framework.interop
in the .NET framework? I understand that I can manipulate windows service (to stop, to start etc.,) using ServiceController class. But how can I programmatically set the username and password of an already installed windows service? Any help is appreciated. Regards. Raghu/..
DllNotFoundException (2 replies)
microsoft.public.dotnet.framework.interop
I'm trying to platform invoke one of our legacy DLLs. When I try to use the constructor for a class in the DLL, I get a DllNotFoundException with a Message of "Unable to load DLL" but no reason why. The DLL is in the system32 directory so it should be found. How am I supposed to determine what the problem is when the (lame) error message doesn't give me any clue whatsoever (such as a return code, ...
I want to call LogonUser, then copy a file as a different user (3 replies)
microsoft.public.dotnet.framework.interop
I have a Windows form app. It switches identity by calling LogonUser, then calls WindowsIdentity.Impersonate. While I'm impersonating, I'd like to copy a file from my machine to another machine in the domain via System.IO.File.Copy. I'm getting an "access to the path target path is denied" exception. If I log on to my machine as the user, and copy the file via Windows Explorer, it works. I've trie...
Parsing Nested Structure returned from MapViewOfFile Win32API (2 replies)
microsoft.public.dotnet.framework.interop
Hello I have struggled for two days and whenever I thought I figured it ALL OUT, I got more confused. So any suggestions or help is greatly appreciated Example: struct MailItem { char fieldOne[8] char fieldTwo[8] } struct MailItemBlock { struct MailItem DataBlock[ 100 ] int currentIndex; } Now to the questions, 1. How do I marshal the structure array ( ValByArray or Struct or PStruct ) 2. How do I...
Function Pointer to API Call (2 replies)
microsoft.public.dotnet.framework.interop
Hi all, I'm trying to use an API call (namely SetWindowsHookEx) from VB.NET, and I am having problems getting the handling function's pointer. In VB6, the addressof operator would have worked just fine, but in VB.NET, the addressof operator returns a System.Delegate type, so I am not sure how to get around this. The API call is expecting a numeric type, so I can't just pass a delegate type (at lea...
interop2-sample: CLSCTX_LOCAL_SERVER instead of INPROC_SERVER ? (2 replies)
microsoft.public.dotnet.framework.interop
Hello, I'm looking at the interop2 example from MS to get a .NET Server which can be accessed from unmanaged code via COM. The example works fine as does my own application based on it. Now I came to the situation where I want to have 2 separate unmanaged exe's accessing the same .NET server. The problem is, that the example uses CLSCTX INPROC SERVER, which means that the .NET part runs within the...
Geting file size from MapViewOfFile (6 replies)
microsoft.public.dotnet.framework.interop
I am using the following two lines to locate and retrieve an existing memory mapped file. m mapHandle OpenFileMapping (privilege, false, name); address MapViewOfFile(m mapHandle, privilege, offsetHigh, offsetLow, 0); Platform SDK states that if the size parameter of MapViewOfFile is zero that the entire file is mapped. How do I find the size of the map (file)? Quark
.net, com+, no methods (3 replies)
microsoft.public.dotnet.framework.interop
I've created a class, basically following these KB instructions: http://support.microsoft.com/default.aspx?scid kb;en us;Q306296 It all works fine. I run the test vbs and the dialog box comes back with "hello world." I'm trying to call this class with another app through COM , but it keeps telling me the Say() method doesn't exist. I go into component services and no methods show up under the MyCl...
COM Interface allocating and returning a reference to a safe array in C# (2 replies)
microsoft.public.dotnet.framework.interop
A COM interface defines the following method: GetStandardTableEx(string name,string name,ref obj values) Values is a SAFEARRAY allocated by the COM server returned to the client. I can get the VB at the end of the message to work. But if I try the following C#: Object tablevalues; document.GetStandardTableEx("BLENDS","",tablevalues); the compiler says C:\WINNT\Profiles\jonesc\Personal\Visual Studi...
XMLDataReader & CryptoStream together? (2 replies)
microsoft.public.dotnet.framework.interop
Hi there, I try to decode & encode my XML data. My idea is to use a CryptoStream in the middle between DataSet and XML. Instead of : DataSet XMLTextWriter I will do DataSet CryptoStream XMlTextWriter This works pretty good: XmlTextWriter w; DataSet d new DataSet(); w new XmlTextWriter("myXML.xml", Encoding.UTF8); // I put some data into d from SQL // ... and then, instead of d.WriteXml(w); w.Close...
Managed C++ and pinning question.. (4 replies)
microsoft.public.dotnet.framework.interop
Hi folks, First off, sorry for the cross post but I am not sure where this question belongs... The project is an ASP.Net application that needs access to an object model written in C (no managed code at all). So I did the following: 1) Wrapped a couple of the C classes in MC and compile as managed DLL. 2) Added reference to ASP.Net/C# application. 3) Call into the code through the managed wrappers...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com