all groups > dotnet interop > december 2004
Filter by week: 1 2 3 4 5
Unable to successfully return data from dllimport function (C#)
Posted by seths at 12/31/2004 7:31:01 AM
I am having difficulty figuring out which datatypes to use for return values
in a particular DLL import function (C#).
I am trying to use the CryptGetKeyParam function from the ADVAPI32.dll API
call to return certificate information. I am able to successfully call
CryptAquireContext, and C... more >>
C++ dll -> C#
Posted by FikiMiki at 12/30/2004 6:50:25 PM
I have created dll with 2 simple functions written in C++ (Visual Studio
..NET)
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
HHOOK hHOOK;
/..../
__declspec(dllexport) void __cdecl MyAPP2SetHook(HINSTANCE hMod, int
dwThreadI... more >>
How do I accomplish inter-process/applicaiton communication?
Posted by Andrew S. Giles at 12/30/2004 11:55:03 AM
It has arisen that I need to be able to talk from my application (C#) to
another application (unmanaged C++) that runs in a different thread, and vice
versa. I have tried the COM interop, but I keep getting new copies of the
class instantiated, instead of talking to the one alreay running. I... more >>
Marshalling COM components between threads in dotnet
Posted by clive.nospamming NO[at]SPAM ntlworld.com at 12/30/2004 7:51:37 AM
Hi,
I'm hoping someone can help here.
In C++, if you create a com object in a thread running as an STA, &
then want to use it on another thread running either as an STA or MTA,
then the interface needs to be explicitly marshalled using, for
example CoMarshalInterThreadInterfaceInStream.
Now,... more >>
Dynamically Created Licensed Active X controls and Interop
Posted by talon2112 at 12/29/2004 10:48:17 PM
I am encoutering a problem when attempting to create Licensed Active X
(VB) controls dynamically. I get a 747 "No design time license
information found..." error.
I have read the KB arcticles on using Licensed Active X controls in c#
interop scenarios, but our situation is a bit different.
... more >>
Casting Manged Array To Unmanged type
Posted by T. Ford at 12/29/2004 6:33:07 PM
If you have something like this:
Byte myArray[] = new Byte[someSize];
And you pass that to a Win32 function using P/Invoke, is it possible to then
cast that array to the "real" unmanged type that is contained within that
Byte array? E.g. if you wanted to cast that array to an array of
P... more >>
COM Interop messes with IE hosted windows forms control
Posted by Dilip at 12/29/2004 1:59:31 PM
Hi
I have a windows forms user control that is hosted in IE. This control
uses COM Interop to access some RTC related interfaces. The control
does not display itself correctly because of this COM reference. IF I
remove all references to the tlbimp'ed COM dll, the control displays
just fine... more >>
Marshaling
Posted by Nikolay Petrov at 12/29/2004 1:21:00 PM
Guys, please help. I am trying to make this work from at least 4 months.
I am new to programming and some things are difficult to me, but I really
need to make my project work.
I can't find anything helpfull in internet for 4 months ;-( .
Please someone who is more expirenced help me.
I am t... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Locate assemblies referenced by the interop dll
Posted by Perry van Kuppeveld at 12/29/2004 11:56:06 AM
Hi,
I have the following situation:
In one folder on the harddisk i have a lot off vb stuff, i.e. C:\VBProg
In this folder there are several dll and exe files, all vb6.
I also have on the same harddisk a lot off dotnet stuff, in C:\DotNetProg
In this folder also several dll and exe files,... more >>
Terminal Server API
Posted by Nikolay Petrov at 12/29/2004 10:29:01 AM
I am makeing an app which uses WTS API function.
I have done most of it, except a little part where I should marshal a
structure from pointer.
I have found some code in newsgroups, but it is in C# and I use VB .NET.
I've tried to convert it by my own, but it gives me some errors in IDE.
... more >>
For_Mattias_Sj=F6gren,_PLEASE_HELP!!!!
Posted by heino at 12/29/2004 7:08:23 AM
Hello Mattias,
Happy New Year!
I am trying to use
GetHdevmode/SetHdevmode to set public and private portions of
DEVMODE structure.
Can you give me any hint, post an example in C# that shows how to
change printer settings??
Million thanks in advance.
heino
... more >>
ExternalException while sending data to the Clipboard on Server 2003
Posted by Thomas Weingartner at 12/28/2004 2:34:14 PM
We have developed a multiple user client/server application using .NET
Framework 1.0 SP2.
Recently we added the usage of the Clipboard and having some troubles on
the target system. The users work with Remote Desktop from Windows 98 on
a Server 2003 system.
If a domain user started the... more >>
Union in VB.NET
Posted by DPC at 12/28/2004 2:18:07 PM
Hello
I am trying to port a C stucture with union 's inside to VB.NET.
I know there is no UNION keyword in VB.NEt, but how can i solve this in
VB.NEt ?
kind regards
Dieter De Preester
... more >>
COM Interop 429-error
Posted by Miro at 12/28/2004 2:39:15 AM
Hello!
I've made a simple .NET .dll assembly which I deployed to another computer
through a Setup-project (.msi-file). I opened Visual Studio Basic 6.0 and
referenced the assembly. When I run the program it gives me: "Runtime Error
429 ActiveX Component can't Create Object". Doesn't the set... more >>
Dynamic Properties
Posted by Demetri at 12/27/2004 6:49:04 PM
I would like to know if anyone can suggest how to implement the following:
We need to have classes who's properties are defined by a database. The
properties can not be hard coded. In addition properties datatype will also
be defined by the database and are subject to change in the future. So... more >>
Memory Allication (Managed VC++ to Unmanaged DLL)
Posted by Weston Fryatt at 12/27/2004 3:20:07 PM
Simple question on memory allocation.
I have a "Unmanaged" Client DLL that I'm creating a Managed wrapper to be
used in Visual Basic .Net and C#..
Current in on the client side of the application, There are points where I
need to allocate a "client side" memory buffer to marshall data into f... more >>
C# to C++
Posted by Ravi Singh (UCSD) at 12/27/2004 9:34:05 AM
Hello all
What would be the analogous c++ statement for this C# code
ComInterface ci = (ComInterfaceClass)Marshal.CreateWrapperOfType(
GenericType, typeof(ComInterfaceClass));
or
(ItemClass) Marshal.CreateWrapperOfType( myObj, typeof(ItemClass)
I tried
Marshal::CreateWrapperOfType(myO... more >>
RAM used goes crazy with Dllimport ?
Posted by Brian Anderson at 12/26/2004 10:07:42 PM
Hello,
I have a native, C++ console app that uses ~26MB of RAM when it runs.
It uses quite a lot of RAM to make some math but will never xceed 26MB.
Now I've made a dll out of this code and use it with DllImport in a C#
console application.
Basically I just access main() and pass my parame... more >>
Help! IHTMLElement Implimentation
Posted by James Hancock at 12/23/2004 11:34:56 PM
Ok, I'm at my wit's end. I've got IHTMLDocumentXXX working and everything
directly from mshtml.dll in the system32 and even (with help from guys in
here thanks!) the Element Collections working right. But I can't get my
IHTMLElement implimentation to work. I get errors on a whole bunch of them... more >>
Returning char* as string
Posted by Bulma at 12/23/2004 8:48:22 AM
As I understood, when returning System.String with interop, .NET tries
to delete it with CoTaskMemFree(). But, this char* points to permanent
part of memory, and should not be deleted. Is it possible to disable
this behaviour (with some marshal attribute maybe)? I know I can return
IntPtr, but I... more >>
SetClientSite() and IE 6.0.3790.0 - Win2003 Server
Posted by R. Kunoth at 12/23/2004 1:25:02 AM
Hi,
I have got a problem with the webbrowser control - IE Version 6.0.3790.0.
You only have this version on Win2003 Server (all service packs installed)
The progam runs perfect with the "normal" IE Version 6.0.2900.2180 onto
WinXP, Win2000 -and- Win98/Me ;-)
Intension:
Use webbrowser ... more >>
What permissions do I need to instantiate a COM object from an ASP.NET application?
Posted by Andreas Voellmy via .NET 247 at 12/22/2004 3:56:09 PM
Hi,
I have an application that reads some data from an Excel file and=
uses the Excel ActiveX object to do this=2E I have written a=
function that opens the document and reads a value out=2E This=
function works fine in when called from a console application=2E=
However, running in an asp... more >>
unable to set a new windows call back procedure
Posted by Danya Samuel via .NET 247 at 12/22/2004 3:55:56 PM
Hi,
I am new to vb=2Enet and am try to migrate a screensaver=
application written in vb to vb=2Enet=2E To capture the key board=
and mouse movements across the screen, i have a hook dll written=
in vc++=2E I have a windows call back procedure which used to=
process the key board and mouse... more >>
null reference exception on DLL call in C#
Posted by Dan Mehlman via .NET 247 at 12/22/2004 3:53:20 PM
I'm trying to implement calls to an existing C-based DLL within a C# program. It sounds straightforward enough, but any calls to the extern functions produce a NullReferenceException.
My code looks like this:
[DllImport( @"e:\jbhexe\sscam.dll", EntryPoint="BAM_calcs" )]
public static extern ... more >>
System.NullReferenceException
Posted by Hey MO at 12/22/2004 11:18:22 AM
>From a class that extends windows form the following works. However,
from a class object I receive
"System.NullReferenceException"
"Additional Information: Object reference not set to an instance of an
object."
// C#
[DllImport("assvcapi.dll", EntryPoint="ASSVC_FetchChildFolders",
CharSet... more >>
Cannot set Cancel param in Excel BeforeSave
Posted by richard at 12/22/2004 6:53:04 AM
According to the article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/VSTOFAQ.asp
it is a known problem that certain events cannot be cancelled programatically
when using the Excel PIA.
Does anyone know if this is going to be fixed? Does anyone know a ... more >>
newbie trying to call into C DLL
Posted by John Mollaghan at 12/21/2004 2:38:23 PM
I am trying to call into a C DLL (fglove.dll) using C#.
I would like to call the fdOpen and fdClose methods. I have included
some of the header file.
I am really new to this, so any help would be great.
typedef struct
{
// The contents of this struct are platform-dependent and subject to... more >>
Need help marshalling to unmanaged C library
Posted by Thomas Connolly at 12/21/2004 1:38:50 PM
Hello List,
I have a c library that has the following signature:
If I have a C function that takes a 'const char* identifierString' as a parameter,
would the following be the correct way to handle this?
[DllImport(DLL_DIRECTORY_PATH)]
public static extern void MyExternalFunction(IntPtr i... more >>
InvalidCastException when calling COM directshow filter method via dotnet
Posted by dacora NO[at]SPAM ofir.dk at 12/21/2004 6:45:47 AM
I'm trying to control the properties on a StreamBufferSource filter
which is part of and graph. The filter is there and the graph also
works(it renders the contents from the streambuffersink).
The filter is an COM object and it should conform to an interface
which looks like this in it original ... more >>
DirectoryServices and ActiveDs Combined. Double Hop issue?
Posted by Nikos Steiakakis at 12/21/2004 1:13:03 AM
Greetings to all,
I have developed a Web service in which I have to access the active
directory, in order to retrieve all the groups in a domain, and also a list
of all the users in a group. I am using WinNT and not LDAP, and I am using
windows authentiaction and impersonation. In order to ... more >>
How do I get the Version of a typelib from a UCOMITypeLib
Posted by Brian R. at 12/20/2004 5:39:02 PM
I used the LoadTypeLibEx to open a COM type lib. This returns a UCOMITypeLib
interface, which when coupled with the Marshaller namespace can get you lots
of info. My problem is that I don't know what to use to get the version of
the type lib.
Is it buried in the LibAttr structure? Or is ... more >>
Making a PIA from an imported typelib
Posted by Brian R. at 12/20/2004 10:57:12 AM
I have a very custom case where a typelib relies on another typelib that does
not have a PIA. We want to make our interop for our typelib a PIA. We
cannot change our typelib at all (interfaces are cemented), so the decision
was to modify the interop assembly created from our type lib to manu... more >>
C# to C++ interop for a string
Posted by Tony at 12/19/2004 11:16:50 PM
I need to call the following C method from a C# application.
char* GetKeyValue(char* name)
I'm sure this is a common question and there should be some docs on it
somewhere, can anyone point me to them.
Thanks,
Tony
... more >>
Get the DllImport library name for method
Posted by jim.wiese NO[at]SPAM gmail.com at 12/18/2004 6:02:32 PM
I was wondering if anyone knows how to get the DllImport library name
for a method? I'd like to use reflection on an existing assembly to
get the library name for a method if it is a PInvokeImpl method.
Thanks in advance,
Jim
... more >>
getting the Form of WebBrowserClass
Posted by Amir Zicherman at 12/18/2004 12:31:01 AM
hello, I'm using the SHDocVw.WebBrowserClass. I'm trying to get the
System.Windows.Forms.Form of the explorer window out of it. how can i do
this?
thanx, amir... more >>
Yet Another: Can't call C++ dll functions from C#
Posted by Jeff at 12/17/2004 9:54:12 PM
I know that this is supposed to be simple, but I just can't get it to
work--I've been at it for several days!!!
Here's my simple c++ class:
// sayHello.h
#include <string>
using namespace std;
class sayHello
{
string sComment;
public:
sayHello(string sCmnt);
~sayHello();
void S... more >>
DllImport and error LNK2001
Posted by Daniel Wilson at 12/17/2004 3:52:01 PM
I am working in VC++ .Net 2003. I am building a managed project that uses a
3rd party API.
I am using DllImport to tell my project about the API.
But I'm getting
error LNK2001: unresolved external symbol "unsigned int __cdecl
ClientAPIrxLen(void)" (?ClientAPIrxLen@@YAIXZ)
Where do I nee... more >>
How can I get DefaultFolder by means of InvokeMember?
Posted by Pino at 12/17/2004 3:36:27 PM
I'm posting here because there's not a newsgroup about reflection and my
issue is about a COM application: Outlook 2003.
I'm using the following code (I'm referring Outlook and using Reflection in
VS2003):
Type otype = Type.GetTypeFromProgID("Outlook.Application",true);
object outlook = A... more >>
Marshaling struct with pointer to itself
Posted by Thomas Connolly at 12/17/2004 12:46:20 PM
Can someone please tell me how to marshall the following?
enum
{
LIFFE_SIZE_AUTOMARKETREF = 15
};
typedef char LiffeAutoMarketReference [LIFFE_SIZE_AUTOMARKETREF];
typedef struct _tagLiffeSettlementList
{
struct _tagLiffeSettlementList* pcNext;
LiffeAutoMarketRefere... more >>
System.ExecutionEngineException
Posted by jhordies NO[at]SPAM gmail.com at 12/17/2004 2:57:20 AM
Bonjour,
je fais actuellement un développement c# avec VS studio .net 2003 avec le
framework .net 1.1.
Celui-ci interface Wininet.dll afin d'établir une connection ftp.
J'envoie une ftpCommand "LIST", j'ouvre le handle renvoyé avec
InternetReadFile, je récupère ainsi les noms des fichier à té... more >>
passing a reference C# to C++
Posted by Ian Lazarus at 12/16/2004 6:06:15 PM
Hello,
How do I get a C# file to call a managed C++ class method whose argument is
a reference to a basic type? I get a C# compile time error message saying
that it can't convert a reference to a pointer. The C++ assembly shows the
parameter as a pointer. Why does it do that?
Thanks
// C++ f... more >>
C++ Sink Event in C#
Posted by MICHAEL CARR at 12/16/2004 3:34:39 PM
I am trying to subscribe to C++ Sink Event in C#, here is how we did it =
in C++.
..h
CComPtr<IPEvents> m_pPortEvent;
DWORD m_eventNotifierCookie, m_ServerNotifierCookie;
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()=20
..cpp
class()
BEGIN_DISPATCH_MAP( CClass, CWnd)
DIS... more >>
Marshaling a String Array
Posted by Rodger Brennan at 12/16/2004 1:11:42 PM
I need to marshal as string array in C# to an IntPtr. Ist there any way to
do this. for instance.
string[] str = { "this", "should", "have", "a", "pointer" };
IntPtr ptr = Marshal.AllocHGlobal(Marhsal.SizeOf(str.Length * str.Length);
Marshal.StructureToPtr(str,ptr,false);
Thanks in Advan... more >>
Adding Reference to COM Library
Posted by PMVT at 12/16/2004 1:03:09 PM
I am developing an addin for Word in C#. In order to support both Word 2000
& 2003, I had copied the appropriate Word 9.0 libraries (mso9.dll and
msword9.olb) to my development machine, which has Office 2003 installed on
it. Everything was great; I referenced the Word 11.0 libraries for the ... more >>
QueryInterface for interface xxx._yyy failed
Posted by Bo Gusman at 12/15/2004 4:26:47 PM
We just released the beta of version 7 of our VB6 based app. We have
documented how to write a VB.Net addin to extend our functionality and
it works just fine using the version 6 release.
One of our beta sites who has written and is selling a .Net addin for
the v6 tried to make his very s... more >>
Excel 2000 vs Excel 2003
Posted by Ian Henderson at 12/15/2004 3:25:30 PM
I have a problem - if I've directed this to the wrong newsgroup, then I send
1000 apologies in advance.
I have developed a database front-end using VS2002, on my own PC, which
currently has Office 2003 Pro installed on it. Part of my front-end app
uses Excel as the reporting output. When ... more >>
C# COM DLL localserver question
Posted by Andrew S. Giles at 12/15/2004 1:21:03 PM
I am working on converting my COM DLL from an inprocserver32 to a
localserver32. I am looking at the article referenced here:
http://blogs.msdn.com/adioltean/archive/2004/06/18/159479.aspx
I am trying to put the C# code for the service, installer, etc into my DLL
code.. and for some reaso... more >>
InvokeMember doesn't get properties
Posted by Pino at 12/14/2004 6:32:27 PM
I'm trying to get some properties from a COM object.
I built WindowsInstaller.dll by means of tlbimp.exe above msi.dll (Windows
Installer objects), then I added a reference to it in VS.NET 2003.
I succeeded with reading some objects reference using Reflection and
InvokeMember method. I used th... more >>
How to dispose a .NET class called from VB6?
Posted by koojo31 NO[at]SPAM hotmail.com at 12/14/2004 3:22:43 PM
I have a VB6 application that calls a .NET class in C#. I compiled the
..NET class with COM Interop set to true (output to a .tlb file), and I
can run the app and call the .NET class no problem. However, I am
having trouble disposing of the .NET class when I am done with it.
I created a publ... more >>
Connect to Terminal Server 2003 via .NET
Posted by Jason Newell at 12/14/2004 2:22:39 PM
All,
I am needing to programatically (.NET) open a Terminal Server 2003
session, execute a program and close the session. Sounds easy enough.
Well, I've gOOgled my brains out and I've found myself right back where I
started, with nothing. Does anyone have some detailed examples on how t... more >>
|