all groups > dotnet interop > september 2006
Filter by week: 1 2 3 4 5
Calling .NET code from ASP
Posted by Mwob at 9/30/2006 9:31:56 AM
Hi,
If I call .NET code from ASP by registering the .NET assemblies with
COM, how can I tell in my assembly if it is being called from interop?
Does anyone know that process actaully executes the .net code - if
asp.net code calls my assembly then obviously the process is
aspnet_wp...
Thank... more >>
C#, Problem trouble shooting PInvoke error.
Posted by karan.shashi NO[at]SPAM gmail.com at 9/29/2006 2:39:22 PM
I keep getting an error while trying to pass a specific struct to a
PInvoked method.
The error code returned when calling Marshal.GetLastWin32Error() is
0x06F8.
I'm trying to consume the setupapi function
SetupDiGetDeviceInstallParams.
The problematic struct is SP_DEVINSTALL_PARAMS.
I fou... more >>
IE Toolbar Visual Style
Posted by David at 9/29/2006 12:28:02 PM
I am currently writing a toolbar for IE in C#, based on the KBBar MSDN sample
http://support.microsoft.com/default.aspx?scid=kb;EN-US;821793
Its all working OK, but does anyone know how to get the toolbar to adopt the
same 3d appearance as the main IE toolbars? The border of the toolbar does ... more >>
VB.NET DLL for use by Classic ASP - calculating HMACSHA1
Posted by Michael Jahnz at 9/29/2006 12:24:39 PM
I need help getting some VB.NET code (via a DLL) to work with classic ASP to
perform HMACSHA1 processing.
I've created VB.NET (ApplicationType is Class Library) code using Visual
Studio 2005, that can calculate a HMAC hash, Base64Encode the result, and
return the value... The VB.NET code is... more >>
Detecting new threads from C#
Posted by Keith Patrick at 9/29/2006 9:45:21 AM
I have a .Net app where I want to monitor other processes & act in response
to the creation, suspension, and ending of threads. Does anyone know if
this is possible without manually sampling the process' thread list (in
other words, actually be notified of these events rather than periodicall... more >>
How do I make C++ enum visible in C#?
Posted by Gregory at 9/29/2006 8:39:02 AM
I have a C++ DLL and Windows Forms C# application. How can I declare an
enumeration in C++ DLL that would be visible to C# client?
I am using Visual Studio 2005.
Thank you in advance.
Gregory Khrapunovich
... more >>
How to Implement IEnumString
Posted by TheInquirer at 9/29/2006 8:14:44 AM
Hi,
there's this type in .NET 2.0 IEnumString.
I'd like to write an implementation of it in my dll which is going to
be used by c++ code through COM.
how can I set the value of pceltFetched properly if this parameter is
not out or ref within the function?
int Next (
int celt,
[OutAttribu... more >>
RCW reference leak with COM events
Posted by Chris at 9/29/2006 5:03:36 AM
Hi,
I have a problem with an RCW reference leak when all of the following
conditions are met:
1. A .NET class implements an interface that is defined by a COM
typelibrary. For the sake of demonstration this COM interface is called
IMyPlugIn. The .NET class is implemented in C# 2.0.
2. Th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
C# interop with classic asp
Posted by elwood.net NO[at]SPAM gmail.com at 9/29/2006 2:08:07 AM
Hi everyone,
I have a .NET assembly that I'm using from classic ASP pages.
One of the methods of my .NET assembly is returning a string array and
I'm not able to retreive this array from the ASP page. I'm having a
type mismatch error if I try to intercept the array.
public string[] T... more >>
App hung using COM behind the scenes
Posted by Scott S. at 9/28/2006 11:39:01 AM
I've got an app that is written in C# using background threads, etc. Two
days ago I added code to try to open an OledbConnection to a SAS file using
the sas.LocalProvider. It seemed simple enough but the app would hang
everytime it tried to open the connection in a background thread.
Afte... more >>
Interop from ASP -> .NET assembly, how to determine caller...
Posted by Mwob at 9/28/2006 7:21:07 AM
Hi all,
I have an assembly in .NET, that I expose to COM for interop by setting
the "Register for Com Interop" setting for the project to create the
TLB file.
This assembly is called from classic ASP pages (because its registered
with COM), and it is also called from other .NET assemblies t... more >>
Memory problems - something wrong with my code?
Posted by Chris Ashley at 9/28/2006 5:49:27 AM
I have been getting 'access violation reading location' errors
occasionally in my app. I have debugged this and found it is one of my
interop functions. Am I doing anything wrong here? The unmanaged
function takes a pointer to some bytes in memory and a long, and
returns a pointer which points s... more >>
MFC interop with .net UserControl - RCW non-deterministic cleanup
Posted by Aled Hughes at 9/28/2006 1:44:01 AM
Hi,
I have an MFC8 application that is using .net 2.0 user controls, either
hosted in a dialog box or a CWinFormsView. However, during this development I
have been experiencing random crashes - especially why I do something like
repeatedly bring up and dismiss a dialog that hosts a .net contr... more >>
IDL
Posted by Thomas Freudenreich at 9/28/2006 12:00:00 AM
It is possible to generate a IDL File in VS2005 C# if I have a ComInterop
project ? Or is there a tool that convert the existing Typelib into a IDL
Description ?
Thomas... more >>
underlying connection was closed: unable to connect to the remote server: COM --> .Net --> WebService --> Error
Posted by Monty at 9/27/2006 9:28:57 AM
OK, I had an issue with this and found lots of advice that did not apply, so
I'm posting what I found hoping it might help someone else. Here's the
sitch: you have a COM app that calls to a .Net assembly which in turn calls
a web service. You know the web service is reachable and that the COM ... more >>
disp interface
Posted by Roy at 9/27/2006 6:52:01 AM
I want to rewrite a legacy MFC COM code in C# and DO NOT want to modify and
compile any client code who uses the component at this time. Here is part of
the interface definition. The idl also expose some enum definitions. Any idea
if it can be do easily and how? Some of the interface do not re... more >>
Stepping through c# code in two different solutions
Posted by paul NO[at]SPAM paullee.com at 9/27/2006 3:54:25 AM
Hi everyone,
Hopefully someone can help, and that I'm asking in the right place!
I have two sets of solutions, both with source code. The first project
is an executable, the second a DLL. When I place a breakpoint in the
DLL code and step through it, going through
the call stack, the function... more >>
Automation Error while creating a COM Wrapper object in VB6 COM Application
Posted by Murtaza at 9/27/2006 12:00:00 AM
I have a .NET managed class designed in C#, created COM Wrapper and am able
to create its object in Visual Basic 6 Desktop application.
I then created this .NET assembly object in Visual Basic 6 COM Application
method and created the object in it. while called the method from the ASP
client, it ... more >>
FreeHGlobal after PtrToStructure?
Posted by Chris Ashley at 9/26/2006 1:01:45 AM
Do I need to free any memory using InteropServices in this instance?
IntPtr ptrData = m.WParam;
SizeHeight imgType = new SizeHeight();
SizeHeight imgData;
imgData = (SizeHeight)Marshal.PtrToStructure(ptrData,
imgType.GetType());
... more >>
Managed DateTime to unmanaged DATE?
Posted by Hyun-jik Bae at 9/26/2006 12:00:00 AM
Is there any way to get DATE(typedef as double) value from .NET DateTime
object?
Please reply. thanks in advance.
Hyun-jik Bae
... more >>
Pass COM object as Function Argument
Posted by Turtle at 9/25/2006 10:57:22 AM
I've got a .NET application which needs to interface with a "legacy" VB 6.0
application. A great deal of the information the .NET application needs is
encapsulated in a class in the legacy application, so it would be great if I
could just pass an instance of the class to the .NET application.... more >>
Referenced Assembly
Posted by Erencan SAÐIROÐLU at 9/25/2006 12:00:00 AM
Hi All,
I have referenced an dll my project. The dll has develop not .NET framework.
How can i create an assembly for this dll.
Please help me.
Thanks to all.
... more >>
CCW/AppDomain unloading
Posted by lazerbeam at 9/23/2006 7:18:01 AM
Hi,
I have a managed class which is being used by an unmanaged client (via COM
InterOp, Internet Explorer).
I basically understand how this works (IE calls CoCreateInstance(Ex), CLR
gets loaded, AppDomain(s) created, CCW created, yada yada ...).
Question: Is it possible that the host p... more >>
Effecient way from C++ byte[] to CLR object?
Posted by Hyun-jik Bae at 9/22/2006 8:04:33 PM
What is the effcient way copying byte block from native C++ code to CLR
object?
I know there is C++/CLI array<BYTE>, however, I don't think it will be
effcient because it needs loop and copy for each array element as far as I
know.
Please reply. Thanks in advance.
Hyun-jik Bae
... more >>
COM Factory for managed objects?
Posted by arunprakashb NO[at]SPAM gmail.com at 9/21/2006 2:53:46 PM
Hi All,
I am trying to do this and am stuck in one place. If someone can help
me it would be great. I have a managed object exposed to COM via
regasm.
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IPanel123
....
[Serializable]
[Guid... more >>
add reference converts COM Long to C# int
Posted by Ronan at 9/21/2006 9:46:02 AM
When I add a reference to a COM dll using add reference in by c# console app,
the VB6 COM long variables of a function appears in the intellisense and
debug errors as an int.
From MSDN the sizes of the variables are:
com INT Holds signed 32-bit (4-byte) integers ranging in value from
-2,1... more >>
parsing arrays to COM
Posted by ms at 9/21/2006 8:21:18 AM
Hello,
i want to use a COM-function who is declared like the following
(IDL)
HRESULT SetPlcData (
[in] BSTR bstrPlcString,
[in] SAFEARRAY(long) * lPlcMarkers,
[in] SAFEARRAY(long) * lPlcDWords );
Since i add a reference to my Studio 2003 Project (c#) to the... more >>
Problem in calling a COM dll function from C# .Net Web method
Posted by PMH at 9/21/2006 12:00:00 AM
Hello,
I have created a COM DLL which has one functionality exposed through
interface.
Now in my Web Application I made the reference to that DLL.
I created the object and called the funtion.
But after calling the function i assigned the object to null.
Problem is refence is not gett... more >>
Regasm and GAC problem
Posted by MSMVP KenLin for VB.NET at 9/21/2006 12:00:00 AM
Dear all,
I have one exe, it depends on some dll file. And they are interop
assemblies.
I run regasm /codebase, the application can run up sucessfully.
But if I only run regasm without /codebase, and install the dll to GAC, then
the application fail to start. It said "failed to
initia... more >>
Why the "STAThread" not work
Posted by YeJianWei at 9/20/2006 11:15:01 PM
Hi, guys
I have a COM interop object (named as "PlantWrap") which is written with
managed c++, the plantwrap is a wrapper for another COM based server, and the
threadmodel of that COM server is apartment.
To call the plantwrap in work thread, I have to initialize the COM library
and thread a... more >>
Catch event from c# dll in VB6 app
Posted by ogled at 9/20/2006 12:41:36 AM
Hi
I have a vb6 dll that i want to replace with a C# dll (slowly migrating
towards a fully dotnet coded application), but I can't get the event to
work. I've gotten all the methods to work, but there is an event that i
can't catch ( i can't see any event in vb no matter how I declare it)
In... more >>
regasm problem - changing case of methods and properties
Posted by arothberg at 9/19/2006 2:07:02 PM
I'm experiencing odd behavior with regasm when generating a tlb file from a
managed assembly. The resulting tlb file contains method/property names on
the exposed interfaces that are of a difference case than the method/property
names of the original assembly. This is not consistent behavior... more >>
C# 2.0 dll in Excel 2002
Posted by katzky at 9/18/2006 9:13:02 PM
I am having great difficulty using my .Net 2.0 dll in an excel 2002
application. I've coded it correctly but I've found an unusual (?) problem:
Excel is loading the .Net 1.1 version of the mscorlib.dll instead of the v2.0!
In Excel the mscorlib.dll is the wrong version [v1.1.x.x]
=========... more >>
Simple COM DLL Interop Issue
Posted by Daniel Deptford at 9/18/2006 1:17:11 PM
Hello. I've written an in-process server, designed to be multithread safe.
I've set the ThreadingModel in the registry to be "Both". Essentialy the
IDL is:
[
uuid(9691F40B-A394-40fb-BEA7-973C93F2EE20),
version(1.0),
helpstring("Test COM server")
]
library MyTest
{
[l... more >>
Multiple WebBrowser controls with multiple Excel files
Posted by JLB at 9/18/2006 10:09:01 AM
I'm writing an MDI app in VS2005 to interop with Excel 2000. I want to
provide the user with the ability to view and interact with multiple excel
files, each being displayed in its own child window/WebBrowser control. The
problem I am having is that when the second excel file is opened in it... more >>
Get length of IntPtr in bytes?
Posted by Chris Ashley at 9/18/2006 2:21:37 AM
I am using Interop with a C++ function which returns a pointer to an
array of bytes. I'm using an IntPtr and Marshal.Copy to populate a
managed array of bytes in C#, however I don't know the size I need to
allocate to the array. Is there any way of calculating the size of the
memory IntPtr is po... more >>
Owner of winform in excel
Posted by Torben Laursen at 9/17/2006 6:03:28 PM
Hi
I am using a winform inside excel from a com add-in.
But when I open the form it has its own button on the Taskbar
I guess that I get get rid of it by passing excel as the owner when I show
the form but how do I do that?
thank
Torben Laursen
... more >>
Excel hangs on automation add-in worker thread
Posted by Jim Cross at 9/17/2006 8:49:09 AM
Hi all,
I've got an automation add-in which calls a web service and returns the
results.
As the web service may take an arbitrary time to return the response, I make
the call in a worker thread, and use workerThread.Join(timeout) in the main
thread to apply a timeout. If the timeout occurs... more >>
C# dll in VB6 app
Posted by Tony at 9/17/2006 12:35:34 AM
I've seen several messages and read through them and MANY websites and
various MSDN items and still don't have a solution.
I made a dll in C# from the code below for testing
using System;
using System.Runtime.InteropServices; // necessary library to use COM
attributes
namespace mcMat... more >>
NetValidatePasswordPolicy - Validating a password against the pass
Posted by Daniel Brown at 9/16/2006 8:55:01 PM
Hello everyone,
I’ve been trying for 2 days now to find any example or using
NetValidatePasswordPolicy and actually making it work.
However, I’ll explain my situation first, in case someone can think of
another means.
I wish to extend the C#/.NET2.0 Logon Control to validate passwor... more >>
How To: C++ DLL function returns Structure Array to VB .NET
Posted by lov4mu6 NO[at]SPAM gmail.com at 9/15/2006 5:24:13 PM
I have a DLL that I've compiled in Visual C++ which I'm referencing in
VB .NET
The function in the DLL returns a simple structure array. I need to be
able to capture this structure array in VB .NET.
C++ code:
struct NotesInfo
{
int Note;
int StartTime;
int EndTime;
... more >>
Detect if Workstation is locked
Posted by ThunderMusic at 9/15/2006 12:54:43 PM
Hi,
I want to detect in my C# app (can use iterop) if the workstation is locked.
I've seen on the web people saying it's impossible except by looking if the
Screensaver process is running. There must be a clean way of doing it
because MSN detects it and can change your status based on this.
... more >>
Problem getting UserGUID from Exchange OnSave event sink
Posted by timd at 9/15/2006 8:41:02 AM
Hi, I suspect that this is an interop problem, can anyone help?
I'm having trouble getting the id of the user who caused an OnSave event on
a calendar appointment. It is supposed to be available through the
IExStoreDispEventInfo interface but it just causes an exception.
**** EX... more >>
Excel interoperability problem
Posted by jpl at 9/14/2006 4:01:01 PM
I am trying to understand why Excel fails to interact with user when it runs
side by side with a win form application with embedded Excel Object. The
following is the description of the problem.
Excel does not respond to user's interation when Excel runs before the win
form App, it works fi... more >>
Ability to enumerate or get a listing of DocumentProperties/ CustomDocumentProperties for a Word Doc
Posted by Holden at 9/14/2006 12:08:08 PM
OK. I have searched long and hard and wanted to know if there is an
easy/elegant/direct way to enumerate through all the DocumentProperties
and the CustomDocumentProperties for a Word document using C#.
For example say clearing all the DocumentProperties and the
CustomDocumentProperties. (usin... more >>
Unable to find entry point - Bad signature?
Posted by Chris Ashley at 9/14/2006 1:49:16 AM
I'm receiving an 'unable to find entry point' error on the following
DLLImport:
[DllImport("S:\\Core_Dev_PreViewInterp\\Build\\ImageFile.dll",
EntryPoint = "PB_Uncompress")]
public static extern void PB_Uncompress(ref byte[] pOut, ref byte[]
pIn, uint numBytes);
The C++ declaration is as... more >>
a urgent help
Posted by blazerguns at 9/13/2006 10:45:35 PM
Hi,
Can anyone tell how can i enable/disable serial port? sample code would
help. Either using win32 apis or uing .net framework will help. Some
sample code please.
Varun
... more >>
need help translating marshalas from C to vb
Posted by GS at 9/13/2006 10:02:17 AM
C code:
[MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)]public char rgwz;
Tried Vb codes;
<MarshalAs(UnmanagedType.ByValTStr,SizeConst=100)>public char rgwz;
<MarshalAs(UnmanagedType.ByValTStr,SizeConst As Integer =100)>public char
rgwz
<MarshalAs(UnmanagedType.ByValTStr,SizeConst As... more >>
Reflection messing up the type hierarchy
Posted by Emmanuel Stapf [ES] at 9/13/2006 8:26:24 AM
Hi,
I've discovered in .NET 2.0 that for some reasons during reflection the
System.Object parent of a ComImport marked class is swapped with
System.__ComObject.
Here is a sample that shows this:
Assembly a = Assembly.LoadFrom(@"c:\Program Files
(x86)\Microsoft.NET\Primary Interop Assemb... more >>
MarshalAs attributes
Posted by Brian M at 9/12/2006 9:40:33 PM
I am wondering if every single field of a struct needs to be completely
attributed or if the runtime will marshall standard types "automagically"...
This would be the PInvok'd api call:
[DllImport("mywork.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Ansi)]
public s... more >>
|