all groups > dotnet interop > june 2006
Filter by week: 1 2 3 4 5
Cursor set impossible for a migrated VB6 UserControl
Posted by Bruno BERTRAND at 6/30/2006 5:44:50 PM
Hi,
I've got a UserControl created years ago in VB6.
I can migrate the project which uses this control into VB.NET 2003.
Everything's fine. But...
When in the form class, if I do such a thing:
Me.MyUserControl.Cursor = Cursors.Hand
there is just no effect while I can do it well with any .... more >>
Windows CE 4.2 - PInvoke Problems
Posted by Thorsten Dittmar at 6/30/2006 12:51:29 PM
Hi everyone,
I'm writing a little tool for a Windows CE 4.2 handheld device in C# (VS
2003, Compact Framework). I need to import functions from a dll supplied
by the manufacturer.
The header file includes the following declarations:
enum DLBT_PicoWizardCallback
{
DLBT_CALLBACK_FNC,... more >>
Enum not visible
Posted by Nathan at 6/30/2006 4:48:01 AM
I have an assembly in VB.Net that has a single ComClass in it to allow
existing VB6 applications to use it.
I've recently had to upgrade it to VS 2005 and in doing so found more
classes in the assembly now appear to be visible to COM.
To counteract this I have set all .Net classes and asse... more >>
Passing C# string to unmanaged C++ function const char* input parameter
Posted by Mike Price at 6/29/2006 8:15:25 AM
Hello,
I have been muddling through posts about this sort of thing for
days and my understanding is the framework should be able to convert my
string to const char* by default (without any kind of explicit
conversion/marshalling) but I get the following exception when I do.
{"Attempted... more >>
what are major points about memory management in .net interopservice
Posted by dotNeter at 6/29/2006 7:46:00 AM
When we do interop between managed and unmanaged code, one of the most
hardest thing is memory management. When we should allocate memory and
copy data? Who is responsible for freeing memory? How about object
life-time? It's a very big problem to me. There is no such valuable
stuffs which summar... more >>
Opening a VB6 non-modal form from .NET
Posted by Ole Myhre at 6/28/2006 5:09:15 PM
Hi,
I'm working against a large system written in VB6, and have to display some
forms through COM from .NET.
However, I can't get this to work. When I try to show a non-modal form from
..NET, I get an exception with the following text: Non-modal forms cannot be
displayed in this host app... more >>
Does interop automatically free strings allocated in unmanaged code?
Posted by Bob at 6/28/2006 2:56:12 PM
For example:
[DllImport(...)]
public static extern void MyFunc(
[MarshalAs(UnmanagedType.LPWStr)]
out String myString);
If native code allocated myString using CoTaskMemAlloc, is it freed
automatically here? What if the string was allocated using HeapAlloc -- how
would it know ... more >>
Word tlb - ActiveX component can't create object (again)
Posted by Rob Oldfield at 6/26/2006 1:34:02 AM
Apologies for the repost, this is due to me not doing it correctly to fit
terms of an MSDN subscription.
I've built a tlb for Word 2000 in VS 2003, and it's failing intermittently
with the error above. The general idea I'm using is as described in this:
http://www.codeproject.com/dotnet/O... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
COM Interop with VB - machine.config problem
Posted by robert.beattie NO[at]SPAM gmail.com at 6/23/2006 11:07:55 AM
I'm attempting to have a MTS VB COM DLL make a call to a C# .net DLL.
My problem lies with the .net DLL accessing config values in
machine.config:
strIP =
((NameValueCollection)ConfigurationSettings.GetConfig("mySettings"))["myValue"];
The call to GetConfig returns null. This works when ca... more >>
Hiding AddIn Methods from Worksheet Functions But Exposing to VBA
Posted by Matthew Wieder at 6/23/2006 7:00:02 AM
Our Automation Add-In has some methods that return object types Excel not fit
for Excel (one of the methods retunrs a custom collection for example). Is
there some way to hide this method so the end user won't try and use it as a
worksheet function, yet have it visible so that it can be used ... more >>
Syntax for pointer to struct
Posted by Peter Wone at 6/23/2006 12:00:00 AM
What's the C# syntax for getting a pointer to a struct, so you can pass it
as an untyped parameter like lParam?
And please nobody tell me that I can alias PostMessage and type wParam as
ref NMHDR because I already know that. There is a way of getting a pointer
to a struct or a variable and ... more >>
Outlook 2000 and VS 2005?
Posted by TCook at 6/22/2006 2:54:39 PM
Hey All,
Simple yes / no question that I haven't been able to find a simple yes / no
answer to.
If I build an Outlook addin in VS 2005, will it be or can it be compatible
with Outlook 2000?
Thanks & Regards,
TC
... more >>
Hiding Methods in Automation Add-In
Posted by Matthew Wieder at 6/22/2006 2:03:01 PM
In VS 2005 and Excel 2003. I am writing an Automation Add-In in C# and don't
want to expose the Object methods (GetHashCode, GetType etc.) to end users to
put in their cell formulas. A post here
http://groups.google.com/group/microsoft.public.dotnet.framework.interop/browse_frm/thread/fbc3f32... more >>
Powerpoint saveas
Posted by neoret NO[at]SPAM gmail.com at 6/22/2006 3:03:31 AM
Hello.
I have managed to use the saveas method to both excel and word. Now
it's only the powerpoint remaining... This is how I have written it:
theActivePpt.SaveAs(filename,
Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsDefault,
Microsoft.Office.Core.Ms... more >>
Instantiate Bitmap from unmanaged array/ Allocation problem
Posted by fstorck at 6/21/2006 11:51:02 PM
Hi,
I'm struggling with the following problem:
I have a large unmanaged buffer, allocated with VirtualAlloc for
performmance reasons. I use this buffer to load prepared bitmap image data
into it.
For displaying, I tried to instantiate a bitmap object the following way:
// ButPtrStart p... more >>
Calling COM+ objects from a Windows Service in .NET
Posted by Francis Brown at 6/21/2006 8:47:50 PM
I'm rewriting one of our Windows Service previously written in C++ in .NET.
The service is calling COM objects in a COM+ server application on the same
machine (no call occurs from COM+ to my service). The Service is running
under the LocalSystem account.
When running the service, the C++ c... more >>
Stack prob. Setting callback in native dll.
Posted by dlbriggs1729 NO[at]SPAM yahoo.com at 6/20/2006 2:09:58 PM
I have a 3th party dll writen in C. I have no problem calling most
functions in the dll from the managed code. But there is a function
that take a function pointer for setting a callback function that I am
having problems with.
I have the following code:
First in a wrapper class
[DllIm... more >>
How to kill a thread blocked on an interop call?
Posted by Christopher Carnahan at 6/20/2006 11:02:20 AM
I need to figure out how to terminate a thread while it is blocked trying to
create a COM object via interop.
In a worker thread, I do something like this:
Type t = null;
Object activatedObject = null;
Legacy.IScheduled comObject = null;
t = Type.GetTypeFromProgID(ProgID... more >>
Multiplatform & Interop
Posted by Lloyd Dupont at 6/20/2006 12:00:00 AM
If I write a pure C# application, only using the standart publi API, no
interop, the same binary should work well on32 bit, 64 bits and perhaps on
the compact framework as well if I link against it.
Now how could I achieve the same thing if I do interop and I have a managed
C++ API?
let ... more >>
c# <-> c++ interop - Array of struct
Posted by Varun Bansal at 6/19/2006 10:46:32 PM
Hi,
I want to return an array of structures from a C# dll to native C++ client
application. The structure looks like this:
public struct mystruct
{
public string strName;
public string strDesign;
public bool bValid;
public bool bLocal;
pub... more >>
WaitForMultipleObjects & CoInitalizeEx
Posted by Andrew at 6/19/2006 7:32:15 PM
I'm interfacing with a mostly undocumented 3rd party COM object in C#.
It seems to be working, but I'm not sure if it's working "right". :)
I'm a bit confused about the call toWaitForMultipleObjects
which is currently defined like so:
[DllImport("kernel32.dll")]
static extern uint Wait... more >>
killing blocked com object
Posted by ZQ at 6/19/2006 3:32:40 PM
Hi all!
Check this out:
Thread t = new Thread(new ThreadStart(WorkSomething));
t.Start();
if (!t.Join(1000 * 60 * 7)) t.Abort();
WorkSomething is caling unmanaged code at one point (a COM object), and that
code sometimes "blocks" and keeps the CPU usage up on 99% without doi... more >>
Using GetObject to get instance of running COM Server
Posted by John Faris at 6/19/2006 12:30:43 PM
I have a class within a class library that I have exposed as a COM Server.
The library is used by a a win forms app written in C# .NET 2 that creates
an instance of the class when it starts. I want to be able to use GetObject
from a VBS script to get a reference to the instance of the class t... more >>
Return of VARIANT works in VB.net, and not it C# ??
Posted by Rmz at 6/19/2006 12:05:02 PM
We have a COM object that a 3rd party provides us. All of our code is in
c#. What we've found is that:
In VB.net we call the method and the COM object returns an System.Array of
strings, works great.
In C# we get an empty System.Array returned.
Here is the method we're calling (from... more >>
First mouse click fails in modal window of native COM object
Posted by SergeyR at 6/19/2006 9:47:02 AM
Hello
I am writing a COM object(component) in C#. There is an interface(called
IBatchConfig) I should implement in this COM object. In particular, this
method of the interface:
public void Configure(int hWnd, object pTaskTopic, object pConfigTopic)
which brings up a modal dialog of thi... more >>
help AccessViolationException in 2.0 not in 1.1
Posted by Gunnar at 6/19/2006 12:00:00 AM
I'm doing interop by calling method in a c dll. I'm passing strings as
Stringbuilder. This works fine in 1.1, but I have now migrated to 2.0 and
get AccessViolationException. Message= Attempted to read or write protected
memory. This is often an indication that other memory is corrupt. when I ... more >>
COM Interop - Using .NET Singleton Cached data
Posted by Ayoa at 6/18/2006 8:33:51 PM
I have a c# assembly which i have exposed to a VB COM object.
Within the c# assembly, i implemented a singleton pattern which loads the
cached from the database if the cache is null. This data does not change
often but take long to load so i have cached it.
c#
private static RuleChecker my... more >>
Getting a COM object from a DLL call
Posted by Chris Austin at 6/17/2006 7:52:29 PM
Hi,
I am trying to use a fairly old library with VB.Net
It is COM based, so I have just added a reference to it and that bit is OK.
The problem is that the main object that needs to be created, must be done
from a DLL call. In VB6, this was just:
Private Declare Function GetEngineObje... more >>
wrappers to call some C++ code from C#.
Posted by Zachary Hilbun at 6/16/2006 4:00:43 PM
I'm tyring to create some wrappers to call some C++ code (below) from C#.
The MSDN documentation is mainly about using COM to do this, but my code is
not COM. In any case, I can't figure out how to do it. I've also tried
using SWIG, again with no luck. Is there any MSDN or internet document... more >>
J# component and COM interopability
Posted by Andy at 6/16/2006 1:12:54 AM
Hi,
I have recently upgraded a number of J++ projects to J#. The process
was relatively painless and I can create and access objects based on
the classes. My problem is that I need to communicate with these
components from a VB6 project. I have checked the COM interop option on
the configurat... more >>
Error: 80070002 The system cannot find the file specified
Posted by Waldy at 6/16/2006 12:00:00 AM
Hi there,
I want a .Net .dll to be available from VB script via COM, so
I enabled the "Make assembly available to COM" option and ran REGASM.exe on
the .DLL, but I get the following error when I try to access it:
80070002: The system cannot find the file specified.
... more >>
COM and .NET interop
Posted by shyam at 6/15/2006 1:33:02 PM
Hello,
I have a COM service which is a very (around 25k+ lines of code) written in
pure COM and C++. We are planning to write a interop wrapper for this to
expose to the new .NET clients(GUI). What will be the best approch to
solve the issue. And the COM idl mostly uses complex structures(p... more >>
ASCII string problem
Posted by Vincent.Arod NO[at]SPAM gmail.com at 6/14/2006 11:35:28 PM
Hi,
I'm using a C DLL in my code which returns an ASCII string value.
Problem is that when i get my string special characters as '=E9' or '=E8'
or not correctly translated.
I try to use CharSet =3D CharSet.Auto but it doesn't change anything :( I
try to convert string thanks to Encoding class... more >>
MFC CString in C#
Posted by wcsleeman NO[at]SPAM vcu.edu at 6/14/2006 1:31:29 PM
As my earlier post would suggest, I am using some C++ unmanaged DLLs in
a C# program. A number of the functions used in the C++ DLL have
CString as a parameter. I cannot seem to figure out the correct way to
expose the CString objects to the C# DLL call. I was able to get
parameters passed using... more >>
Using cached COM pointers in .NET app from STA and MTA threads
Posted by Val Melamed at 6/13/2006 1:20:45 PM
Hello all,
We have a desktop C# application which heavily uses COM objects from
extended MAPI. Sometimes we are seeing really weird behavior, especially
with earlier versions of Outlook. I wonder if we are breaking some COM rules
here: e.g. we obtain a reference to the interface in one thre... more >>
c++ DLL -> C# problem with member variables
Posted by wcsleeman NO[at]SPAM vcu.edu at 6/13/2006 12:22:22 PM
I am trying access a class in a native C++ DLL in C# but the DLL
crashes whenever a member variable is access. I have no problem running
functions (add, getTest, setTest) when they access member variables
(like int val below). As soon as val is accessed (even in the
constructor) the C# program g... more >>
ASP.NET / memset - File or assembly name was not found
Posted by Andy at 6/13/2006 12:02:31 PM
Need help from Microsoft team for frequently reported .NET problem in
newsgroups with mixed dll assemblies.
I have a VB.NET webservice written in VS2003 targeting .NET 1.1. As
the webservice reads MS Word .doc files, it has to call a C++.NET
assembly to access the windows structured storag... more >>
problem with using Outlook/Word
Posted by David R at 6/13/2006 11:49:01 AM
I need to create an email message from my Windows application, address it and
populate it with a given body of text from a Word document. I am using
VS2005 and C#. If found an example that should work, namely the "How to
automate Outlook and Word by using Visual C# .NET to create a pre-popula... more >>
tblexp 2.0 produces corrupt .tlb ??
Posted by gws NO[at]SPAM newsgroups.nospam at 6/12/2006 12:52:01 PM
Hello,
If I export an assembly using tlbexp to a .tlb,and
try to import the assembly in say vc6.0 using
#import "dir\bin\myexport.tbl" I get the error message:
typelibrary not imported .. Can't load load dll
If I copy the .tlb from my collegue (procduced on his system
with the same dotnet... more >>
C# - Interop causing AccessViolationException
Posted by Stephen Cawood at 6/11/2006 2:11:40 AM
thanks in advance...
while trying to pass an IntPtr into a wrapper DLL, I'm getting an
AccessViolationException: "Attemped to read or write from protected memory"
I'm using another function in a similar way (except that one passes in the
pointer by ref) and that one is working fine (thanks t... more >>
C# assembly deployment error.
Posted by milkton at 6/9/2006 3:48:14 PM
I'm working on deploying serveral windows tools.
One is programmed in VB6, the other is in VC++.
The VB6 tools is using a C# dll assembly.(It's called A.dll)
The problem that I have is I can't make the VB6 tool installed
properly.
I made this VB6 tool as a package using Microsoft package & de... more >>
Using the DecryptFile API
Posted by MVB at 6/9/2006 11:13:02 AM
Hello,
I am using the DecryptFile API - BOOL DecryptFile( LPCTSTR lpFileName,DWORD
dwReserved) to decrypt the encrypted files.
Encrypted files do get decrypted using this API , but if the file has a
"ReadOnly" attribute,then the DecryptFile() API fails.
The documentation of the API says "Th... more >>
Implementing COM-Interface in managed code
Posted by HubertEbner at 6/9/2006 6:04:01 AM
I've a COM-Component that requires for some callback reasons that the user of
the COM-Component implements an interface of the component. While the basic
implementation of that interface by managed code is no problem, i've got a
problem with a specific method. The method is defined is defined ... more >>
System.Runtime.InteropServices.COMException (0x80080005): Server execution failed
Posted by IsuruG at 6/9/2006 5:25:06 AM
Hello All!
I've been trying to come up with a web service which enables me to use
outlook remotly with a machine which only has a web browser. I've tried
this with windows forms and it worked without any problem, but the same
thing fails miserably when used as a web service and gives the
... more >>
dllnotfound exception if not in admin mode
Posted by eduwushu at 6/9/2006 4:46:02 AM
Ihave a c# program which is using methods of an unmanaged dll. The problem is
that when i try to run the program in a machine where i dont have admin
privileges it launchs me a dllnotfound exception despite of being that dll in
teh same folder as the executable and being also in windows/system... more >>
Failing to create a C# COM object from VC++
Posted by utnemisis51 NO[at]SPAM gmail.com at 6/8/2006 8:21:06 PM
I'm pretty familiar with interoping with .NET COM objects in Delphi but
I'm having an issue using VC++. I've been reading and trying out the
various methods posted on the web but haven't been able to solve the
problem. If I could please get some help that would be much
appreciated.
Currentl... more >>
VB.Net: Anyone know of a really good interop p/invoke guide?
Posted by WALDO at 6/8/2006 10:12:30 AM
Does anyone out there know of a really comprehensive guide to writing
classes structures and interfaces in VB.Net for dealing with COM
objects/Platform invoke, particularly those defined by Microsoft?
It seems that every time I have to build some piece of interop that deals
with win32 api o... more >>
Compile app that uses ActiveX control without it being registered?
Posted by graemef NO[at]SPAM gmail.com at 6/8/2006 9:25:08 AM
Hi,
I'm using CruiseControl.NET with MsBuild to build 3 versions of my
application. Each one requires a different version of a particular
ActiveX control and won't build if it isn't registered. The problem is
that CC.NET could build any (or all!) version at any time, so
registering the correc... more >>
C#: Retrieving from a C++ function a byte array
Posted by eduwushu at 6/8/2006 12:25:02 AM
Good Morning,
I have a C# class which calls functions implemented in a dll in C++.
One of these functions stays as follows:
[DllImport("WpcapProxy.dll")]
static extern bool ProxyInitializeAdapter(string AdapterName, bool
BroadcastMode);
I want also to retrieve a byte array from this functio... more >>
C++ lib calling from C# reutrn values
Posted by vadaapaav at 6/7/2006 3:47:03 PM
Hi,
I have a managed C++ library with following class.
I am using .NET 2.0 (Visual Studio 2005)
Class1.h....Using /clr complie option
public ref class Class1
{
public:
void set(String^ s,int i)
{
Console::WriteLine("{0}\t{1}",s,i);
}
void get(String^& s_out,int& i_out... more >>
|