all groups > dotnet interop > may 2005
Filter by week: 1 2 3 4 5
Does inheritance work in recreating an interface definition from C
Posted by Frederik Mangelsdorf at 5/31/2005 11:23:01 PM
Dear group,
I'm implementing an Asynchronous Pluggable Protocol. For this I needed the
COM definitions of the interface IInternetProtocol, which in the shipped
headerfile is derived from IInternetProtocolRoot. Because I wasn't able to
find a typelib with the interface, I recreated the int... more >>
Foreach and object leak
Posted by Ed at 5/31/2005 11:00:45 PM
We have an VB.Net application that uses a COM automation server. There is an
object leak that we don't know how to solve.
objColl = autoServer.TheCollection
foreach objMember in objColl
.
.
.
System.Runtime.InteropServices.Marshal.ReleaseComObject(objMember)
next
System.Runti... more >>
Missing events from ActiveX OCX's
Posted by Brendan Grant at 5/31/2005 4:12:34 PM
I have an old custom written ActiveX control, written in VC++6 that I am
trying to use on a Windows form with C# (and also VB.NET for testing).
I add the control to the toolbox using the standard ‘add/remove items’
option, and everything proceeds fine. As does adding the control to the fo... more >>
Calling WSH Method with (ref object) parameter with a string object
Posted by Jono Price at 5/30/2005 6:44:31 PM
Hi,
Fairly bad subject line, but I couldn't think of any better way of
putting it.
This piece of code:
WshShell shell = new WshShellClass();
String SpecialFolder = "AllUsersDesktop";
IWshShortcut shortcut =
(IWshShortcut)shell.CreateShortcut(shell.SpecialFolders.Item(ref
(object)Spe... more >>
Problem in COM Late-binding when exposing assembly to COM
Posted by Fahad Ashfaque at 5/30/2005 4:54:03 AM
Hi,
I am having a serious trouble when calling a .NET Assembly from a NON-CLR
app (VB6 app) through Com Wrapper. The object creation is fine; but when I
try to call its method it says "Object doesn't support this property or
method: 'MethodName'" .
If I add reference to the TLB and do with... more >>
.NET Component called from COM Component not released
Posted by wschaub at 5/30/2005 3:15:09 AM
We have a test environment in which we instantiate a COM/ATL/C++ component
from a Managed/Console/.NET/C# application. The COM component in turn
instantiates and calls a .NET/C#/Class Library component using Interop as
below:
#import "demologger.tlb" raw_interfaces_only named_guids no_names... more >>
Calling C++ from C# Part 2
Posted by Richard MSL at 5/29/2005 8:19:21 PM
I am once again trying to call a MC++ method from a C# method. I am building
with the command line, not the IDE. This is my build file:
cl /clr mc.cpp
csc /r:mc.exe /t:module csh.cs
Here are the source files:
csh.cs
using System;
using MCfu;
namespace InHere
{
public class Ap... more >>
Prevent a field from being marshaled?
Posted by Bob at 5/29/2005 5:46:35 PM
Is there a way to prevent a method from being marshaled in functions like
Marshal.PtrToStructure()? I've tried NonSerializableAttribute and
ComVisibleAttribute, but they don't effect Marshal.SizeOf(). Basically I
just want the marshaler to ignore a certain field, leaving it
unitialized/zer... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
C# client passing a string to C++ server
Posted by JS Ho via .NET 247 at 5/27/2005 5:06:50 PM
I have a C++ COM component. In my .idl, this is the signature of the only method:
HRESULT ValidateWord ([in, string] char word[], [out] boolean *isGood);
Now, I want to call this function from a C# client. This is the method signature I see:
public abstract new void ValidateWord ( System.I... more >>
newbie question: c# and Excel
Posted by Nolan Johnson via .NET 247 at 5/27/2005 8:07:27 AM
Newbie question. I see lots of details about how to use COM to create and manipulate Excel objects from c# here and elsewhere on the web.
We're going to re-work a VBA application that we have that does some complex manipulations of Excel files, and one thing that we're considering is c# or VB an... more >>
Access deny problem
Posted by swapna sp via .NET 247 at 5/27/2005 5:54:52 AM
hai,
iam new to this group. while creating word application in asp.net, I face some problem.
I got the error as access denied while creating instance of word.application class.can anybody able to solve this problem.its very urgent.
with regards
swapna
-----------------------
Posted by a user... more >>
Getting time with Win32 API from C# returns a wrong creation date
Posted by Johan Delimon at 5/27/2005 4:05:24 AM
Hello,
I want to access some files that have paths longer than MAX_PATH so I have
to use Win32 API Unicode functions.
I use these functions to getfiles and information.
[DllImport("kernel32.dll", EntryPoint="FindFirstFileW", SetLastError=true,
CharSet = CharSet.Unicode)]
public static ... more >>
Windows API .NET wrappers
Posted by Mitja Semolic at 5/27/2005 12:00:00 AM
I always come down, to writing wrappers in managed code,
to access Windows API dlls, why there are not simply included
in the .NET framework, or any tool that would build you a wrapper
from a dll?
Rewriting data and methods definitions is a waste of time,
done by all most every programmer usi... more >>
Buffer in managed heap
Posted by Nenad Dobrilovic at 5/27/2005 12:00:00 AM
Hi,
I have an C++ unmanaged DLL which needs buffer to be allocated from
user's code (by using callback function).
I am trying to use that DLL from managed C# code. Can I allocate the
buffer of given size in managed memory and pass the reference to DLL?
This is definition of callback in C+... more >>
pinvoke with arrays of struct in a struct
Posted by news.microsoft.com at 5/26/2005 5:05:42 PM
I am trying to write c# code that calls C code in dlls from an outside
vendor. My documentation is mostly just a header file. I have made some
progress but have a couple of stumbling points.
First may be simple, the header has something like
typedef struct
{
double x;
...
char Fi... more >>
URL image capture...lost???
Posted by emac at 5/25/2005 11:08:28 AM
I need to pass a URL from a .aspx page to some component...part of
framework? that can then do a screen capture of that page...I need to save
..jpg from there....
The user would click a bookmarklet to grab the URL of the page they are
viewing....
I NEED HELP with the capture part only...... more >>
Calling VC++ from C#
Posted by Richard MSL at 5/25/2005 9:28:08 AM
I have a project with legacy code in C, and new GUI code in C#. I have built
a C/C++/MC++ exe that calls a C# netmodule, that all works fine. Now I need
the C# to be able to call functions in the MC++ portion, but I can not make
it work. I have broken it down to a small test case. In my test c... more >>
VC++6.0 / C# Interoperability
Posted by Masi at 5/25/2005 12:00:00 AM
My problem is, that I need to call C# objects from Legacy VC++6.0 code.
Porting to VC7.0 is not an option for now.
For example I have C# class, and I need to call its Test() method.
Any links or better If someone has example of how this is done.
Thanks in advance
-Markku-
C#
=====
pu... more >>
how to access remote com+ component
Posted by mojianjun at 5/25/2005 12:00:00 AM
hello group:
i can create and use com+ component in same computer like this:
SERVER:
using System;
using System.EnterpriseServices ;
namespace MyComPlus
{
/// <summary>
/// Class1 µÄժҪ˵Ã÷¡£
/// </summary>
public interface Class1
{
string Test();
}
public class Serv... more >>
Help with Type.InvokeMember in C#
Posted by Laurent at 5/25/2005 12:00:00 AM
Hello,
I'm having a problem trying to call a DLL assembly from a C# code with
some special parameters.
I have a global class used to store some parameters and work with them:
public class GlobalClass
{
public int parameter1;
public string paramet... more >>
Is it even possible to wrap this method?
Posted by the Shend at 5/25/2005 12:00:00 AM
void *DiracCreate(long lambda, long quality, long numChannels, float
sampleRate, long (*readFromChannelsCallback)(float **data, long
numFrames, void *userData));
Anyone got any clues as to waht a VB.net or c# version would look
like? I've been on this 3 hours and gettin gnowhere fast.
Any... more >>
Using .NET Component from COM Object
Posted by Mike McIntyre [MVP] at 5/24/2005 1:46:43 PM
Is it at all possible to use a .NET component from a COM object without
strongly naming the .NET component?
... more >>
Com Interop. TLBIMP.EXE miss importing method definition
Posted by Casey MacPherson at 5/23/2005 9:28:01 PM
here is the relevant IDL for what's being imported
HRESULT get_monitor
(
[in, string] char* name,
[in, out] long* size,
[in, out, size_is( *size )] nvp_struct stats[]
);
Here is the struct in question
typedef struct {... more >>
AxWebBrowser and System.Drawing.Bitmap
Posted by Jon Shemitz at 5/23/2005 5:53:56 PM
I have an AxWebBrowser control hosted on a .NET GUI form. By handling
the BeforeNavigate2 event, I can trap URL-s like "app:action" and take
the appropriate app action. That was easy: what doesn't seem to be
easy is doing the same thing for <img> tags.
How can I hook into img tag src parsing, ... more >>
Converting IDL to C#
Posted by Marianne at 5/23/2005 11:24:15 AM
There is a large type library whose interfaces and classes I'm going to
closely approximate in my own type library. I have used OLEVIEW to generate
an .IDL file from the type library itself. Would like to be able to convert
this to C# so that most of the skeleton for my type library is alrea... more >>
Cannot reliably shut down Word in finalizer
Posted by Martin Liversage at 5/23/2005 12:04:02 AM
I am using Word via interop to perform some tasks. Releasing alle references
to the Word objects will not close down the winword process. To clean up I
use the following rule: If the Word application object is invisible I call
the Quit() method to shut down word. I wrap this behaviour in a dis... more >>
Threads,Callbacks,Interop
Posted by JDR at 5/22/2005 11:45:22 PM
I am attempting to wrap a couple of COM dlls for use in a C# application.
They are telephony components that raise alot of events through traditional
COM interface callbacks. Basically objects of a type implementing a watcher
interface are passed into an instance and the methods are called w... more >>
SizeParamIndex and IEnumXXX
Posted by LGS at 5/22/2005 5:17:01 AM
My experience doesn't match the docs. Which should I believe?
I'm using C# in vs2003 to call a com interface. When defining an interface
for an enumerator (Next, Skip, Reset, Clone), I was trying to figure out how
to declare the Next. It seemed to make sense to do:
int Next(
[... more >>
Mystical run time error when putting C# library in COM+ application
Posted by Thomas Evensen at 5/21/2005 12:00:00 AM
Hello!
Short description of problem: My C# library works as a COM object (in
process), but when used in COM+ (out of process), I get some strange cast
error run time.
Long description of problem:
I have a C# library which holds a form with a microsoft web browser
component (Ax... more >>
User breakpoint in interop
Posted by Rob White at 5/20/2005 6:51:03 AM
I’m trying to write a .net app that acts as a COM object, for the most part
I’ve been quite pleased with my progress. However, when I get to the point
where I want to pass by ref I run into problems, is there a glaringly obvious
mistake that I’ve made in my code? It all compiles fine und... more >>
Marshalling void pointer from C++ to C# and backwards
Posted by jarmopy at 5/20/2005 12:00:00 AM
Hi,
I have an old unmanaged C++ code with function
func(void *param)
the dll is used in C# code (DLLImport)
The void pointer value is needed in the C# code.
The void pointer is allocated in the unmanaged C++ code (dll).
How can I marshal it to C#.
And how can I marshal it back to C++ ?
... more >>
Native DLLs in separate AppDomain
Posted by Slide-O-Mix at 5/19/2005 4:09:27 PM
I have several native DLLs that I load using managed C++ and the LoadLibrary
function. Some of these DLLs are causing my application to crash (I didn't
write them, they are somewhat of plugins). Some of them are causing what
looks like heap corruption (freeing something twice and so forth). I ... more >>
Login a website programmatically
Posted by Bill Nguyen at 5/19/2005 3:13:17 PM
I'm working on a VB.NET app (not ASP.NET) and need to access a
password-protected website from this application. I tried to use the web
browser control and .Webclient to do this but didn't get it work.
I need to supply the userName & Password to login then go to a particular
menu/page to uplo... more >>
Passing ADO.Recordset to C# - Interop details
Posted by AR at 5/18/2005 4:06:14 PM
I would like to understand the performance implications of passing an
ADO Recordset from VB6 to C# and then accessing the recordset's
rows/fields from C#.
The C# application references the ADODB PIA and everything is working.
The C# method that accepts the Recordset looks as follows: public vo... more >>
DescriptionAttribute for Properties
Posted by Remy at 5/18/2005 3:37:10 PM
It seems like the System.ComponentModel.DescriptionAttribute is not
working for Properties. It works for Methodes and Interfaces. If you
look at the typelibrary you can see the helpstring that gets generated
for the methods, but the properties stay empty...
Here is my code:
namespace LoadLi... more >>
ProgID and VB 6 references dialog
Posted by Scott at 5/18/2005 12:20:02 PM
I have functionality that I have to be used with a legacy VB 6 application. A
assembly has been created that contains a class that implements an interface
with the neccessary methods. The ProgID attribute has been used, note code
example below:
<ProgId("TheName.Testing"), _
ClassInterfa... more >>
Microsoft Document Imaging issue
Posted by seigneurin stephane via .NET 247 at 5/18/2005 6:49:45 AM
Hello,
I am using the Microsoft Office Document Imaging (MODI) which enables to view and use documents created with the Microsoft Office Document Image Writer (created .MDI files).
I use VB.Net.
I am trying to convert an MDI file to several JPG files. Here is the code (it works for thumbnai... more >>
Event or method call to communicate between COM ctl and .NET ctl?
Posted by Craig at 5/18/2005 3:21:11 AM
Hi
I would like to host a .NET Windows Forms user control in a VB6 COM user
control and be able to reuse the .NET control in a purely .NET Windows Forms
application.
I would like the .NET control to be able to respond to events in the host
e.g. menu clicks and toolbar button clicks.
Wou... more >>
Deploying a C# application that uses the Web Browser control
Posted by BillD at 5/18/2005 2:40:07 AM
I have a C# application written in VS2003 that uses the web browser control
(shdocvw.dll) via interop.
I have the application working properly, however, when deploying to machines
with different operating systems or service pack levels to the build machine
the app is unable to load shdocvw.... more >>
MS Word Capturing Events
Posted by Big E at 5/17/2005 4:54:37 PM
Hi,
I'm currently writing a VB.net windows app to do some automation with
word. I need to support Office 2000 and later.
Basically my problem is when a user closes a document without saving
first. I am able to capture Word's DocumentBeforeClose event as well as
the Word Document's Close e... more >>
SystemTimeToTzSpecificLocalTime not accounting for Daylight Saving
Posted by Derick Bailey at 5/17/2005 12:45:37 PM
I'm attempting to convert a datetime from Universal Time (UTC) into my local
timezone... i've got all the timezone data loaded into the proper
TIME_ZONE_INFORMATION structure, and the call I'm making to
SystemTimeToTzSpecificLocalTime generally works, except that this call does
not account f... more >>
Getting LogonUser & CreateProcessAsUser to work....
Posted by WATYF1 NO[at]SPAM gmail.com at 5/17/2005 9:28:21 AM
OK. I've been hacking away at this for what seems like eternity, but to
no avail. I'm trying to start an application from a service. I need
that application to be run as a specified user and I need it to be
visible/interactive. I have looked through every option known to man
and it looks like Lo... more >>
Using ICustomMarshaler
Posted by LGS at 5/17/2005 2:50:01 AM
I am trying to work around a limitation in Marshaling. It appears that
structures that contain arrays of structures cannot be marshaled (c# 2003).
This is demonstrated by the fact that trying to get a Marshal.SizeOf() on
these structures returns a "no meaningful size or offset can be compute... more >>
How to Create COM Object Instance in C#
Posted by Benson at 5/16/2005 9:44:54 PM
Hi,
I have a VS C# project and use a COM object. I added a reference by select
the registred COM component name, I see there is interop reference has been
added to my project, but when I use the Object Browser to browse the just
added reference, there are only interfaces and enum, but no c... more >>
Please Help: Wrapping DeviceIoConrol() for LCD Brightness
Posted by ewoo at 5/16/2005 2:43:19 PM
I'm trying to write a wrapper in csharp to wrap DeviceIoControl() win32
method for IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS control code--without much
luck.
I've seen lots of examples out there for low-level file access but can't
seem to any for the display. Can you provide some samples of how ... more >>
NullReferenceException when passing structures by reference to a C API
Posted by uzairkhan NO[at]SPAM gmail.com at 5/16/2005 12:30:02 PM
I am writing a C# GUI app that will basically make calls to a C API
function named getadminprof() (using a supplied DLL named api.dll).
The C function is defined as follows:
typedef struct person_lst {
char last_name[PARTNAME_LEN];
char first_name[PARTNAME_LEN];
char email_addr[EMAIL_LEN]... more >>
.NET <-> COM interop solution
Posted by gsaviane at 5/16/2005 9:04:22 AM
After reading tons of .NET documentation I don't realize yet the best
solution for my requirements.
I need to develop a .NET out-of-process server that exposes functionalities
via CCW user by old VB6 (COM) clients. Clients and server live on the same
machine across process boundaries. The ser... more >>
What is the equivalent C# structure?
Posted by Mircea Pleteriu at 5/16/2005 12:00:00 AM
Hi,
Using P/Invoke I have to access some functions from an unmanaged dll.
One of the functions is defined as follow:
extern DLL_EXPORT StatistikDaten *GetStatistik(int StatistikNummer);
with
typedef struct Statistik
{
TCHAR WaagenParameterTexte[50][256];
char InformationsTexte[50... more >>
ComInterop (Comclient - VC++, Comserver - VB.NET)
Posted by Red Devil at 5/15/2005 11:57:01 PM
What is the difference in checking the option 'Register for ComInterOp' and
using regasm?
Of coz, the former will create the tlb as well as registering it. The latter
is all manual.
Unfortunately, the latter technique doesn't work when the com client called
createinstance.
Source code... more >>
Manually implement COM interface in C#???
Posted by Zhenxin Li at 5/14/2005 12:00:00 AM
Hello,
I want to implement IUPnPServiceCallback in C#. This interface is not in the
typelib of UPnP dll, so I must implement it myself. Are there any references
to implement COM interface in C# manually?
Best regards,
Zhenxin Li
... more >>
|