all groups > dotnet interop > july 2005
Filter by week: 1 2 3 4 5
Call VC++ functions from CSharp
Posted by kiran at 7/29/2005 12:00:00 AM
Hi ,
I have a project which was developed on VC++ 6.0 Win32 and I made it as
..dll. it exposes few functions.
Then I created a CSharp windows application and want to trying to call those
functions exposed by prev .dll. the functions take parameter which is type
of structure and pointer ... more >>
make header file into class.
Posted by kiran at 7/29/2005 12:00:00 AM
Hi,
1 . I create a VC++ Class Library project.
2. added a .h (head file) to the class library project it contain all the
enueration and structures
3 .I build the library project into .dll (let say x.dll )
4.I created a C# project
5. added the x.dll as a reference to C# proejct.
I ... more >>
Access Exception to IOleContainer.EnumObjects() !
Posted by brooklyn at 7/28/2005 8:07:02 PM
I want to access IOleContainer.EnumObjects() from c#, so I wrapd
IOleContainer Interace with managed code, and get the IOleContainer object
correctly. but found the Exception of "Object reference not set to an
instance of an object".
Thanks for any help.
Here is the code:
//interface IO... more >>
Serialization of immutable struct?
Posted by troy anderson at 7/28/2005 5:35:02 PM
How do you serialize to a file an immutable struct? If I add set {}
routines for all my public properties it works. But my intent is immutable
Thanks
... more >>
C to C#
Posted by Dmitri at 7/28/2005 2:39:15 PM
I have a problem with the following C function from a third party DLL:
int GetStatus(<params>, OUT BUFFER *status);
where:
typedef struct {
unsigned long length; // length of data below
unsigned char *data;
} BUFFER;
In CSharp I defined the function like this
[DllImport("pat... more >>
ShellCmd example blocks WinKey+E
Posted by alex_f_il NO[at]SPAM hotmail.com at 7/28/2005 12:38:28 PM
I have found that ShellCmd example (from .Net SDK) of the shell
extension blocks Winkey+E. The example blocks the Winkey+E on Windows
2000 and XP (SP1, SP2).
Are there working (non blocking) examples of shell extensions?
... more >>
A Directory Service error has occured
Posted by Eduardo Fonseca B. at 7/28/2005 9:38:02 AM
Hello, I have an application that sometime throws me an Exception when is
checking if the user has access to a certain fnction, it uses the
Authoritacion Manager Application Blocks.
Here's the excetption detail.
Exception type: COMException
Exception message: A directory service error has... more >>
COM Interop registration failed. Could not find a type library for assembly 'C1.Common'.
Posted by Paul at 7/27/2005 11:22:41 PM
I'm moving all my stuff to a new machine. One of my control libraries
containing FlexGrid, because it's used in an IDE plugin in VS.NET, has to be
registered for COM interop. Registration works fine on my old machine, but
on the new one I get:
COM Interop registration failed. Could not find a ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
QueryInterface for interface ... failed - ASP.Net
Posted by Philip L at 7/27/2005 3:32:28 PM
Hello, I've found two ways to debug my interop assemblies in my ASP.Net
application and they both have some problems that I haven't been able to
overcome. Google and MSN are running out of answers ;) Here' my scenario...
Method 1.
- Run my DLL in VB6 and attach to VB6.EXE in Visual Studio.
... more >>
Error 1073741819 - NOSPAM
Posted by MICHAEL CARR at 7/27/2005 2:46:43 PM
When trying to connect to COM interface from unmanaged code I get an =
error 1073741819. The failures is intermittent, when I try to catch the =
exception it is not a _com_error. Can anyone help me out?
I am trying to figure out what this error could mean.
--=20
MICHAEL CARR... more >>
Rookie Interop Question
Posted by Stan at 7/27/2005 8:16:03 AM
I've generated an interop for a given COM component. I receive new version
of this COM component frequently, perhaps weekly. Will I need to regen a new
interop dll for each new version that I get? Is there a way to generate an
interop dll that is version independent?
Thanks
Stan... more >>
Unmanaged C++ Struct with Array used via C#
Posted by parlous2112 NO[at]SPAM gmail.com at 7/27/2005 6:27:52 AM
I would like to utilize a multi-precision library (GMP) built unmanaged
C++ (won't build as managed code and don't want to write a managed
wrapper) in my C# programs. I think using interop will be the solution
with least code but am unsure the best approach and would like some
insight. Here is... more >>
WinWord Processes Stay Alive
Posted by Ram at 7/27/2005 4:44:18 AM
Hey,
I'm using an Interop of the Word Com object to create a new word
document.
All went well, but after I finish creating the document, I close it,
and even call the Quit method of the Application object, but still the
WinWord process stays alive...
What do I need to do to make the word objec... more >>
FileDialog filename
Posted by WrzesiƱski at 7/26/2005 10:02:48 PM
Hi all,
How to pass filename chosen by user (with filedialog) to Workbook.OpenText
method? When I use FileDialog.SelectedItems property IDE is showing error,
that this property is not indexed.
--
Przemek
Now playing: nothing... more >>
using MSSCriptControl with C#, params keyword question
Posted by Jozsef Bekes at 7/26/2005 11:14:06 AM
Hi All,
I need to offer scripting possibilities in my app, and have to use
MSSCriptControl for some reasons. I would like to use the feature that's
called variable number of arguments, that is done in C# using the params
keyword. However, if I AddObject the instance to the MSScriptControl, ... more >>
SAFEARRAY** parameter?
Posted by Serg at 7/26/2005 9:29:05 AM
the COM interface method IDL is:
HRESULT Evaluate([in] SAFEARRAY(IpdgMarketEnv*) *mktenv)
and .NET wrapper makes it
Evaluate(ref Array mktenv).
, and it crashes on invalid type. How do I modify the assembly and change
the signature of the method in order for it to accept correct type? - Th... more >>
fixing a jagged array
Posted by Daniel van der Zee at 7/26/2005 12:00:00 AM
Hi,
A have some numerical C code that I want to paste into a C# project. For
example:
public static unsafe void eigen( double **a, // ..other arguments
where a is a matrix, stored as a jagged array (pointer to pointer).
To call this function, I first allocate a matrix as follows:
... more >>
Regasm and Gacutil
Posted by Mister T at 7/25/2005 12:49:10 PM
Hello,
I have a VB.NET program that works with COM Interop. It works fine on my PC
(XP Pro), but when I install it on other PCs (also XP Pro) using regasm it
works on some PCs and not on others. If I install it using gacutil it works
on all PCs.
Any ideas why this is happening?
Than... more >>
Is this ASP.NET problem? No one can answer me so far...
Posted by Yee Huei at 7/25/2005 10:48:05 AM
I have a program written in JAVA,which makes use of java.net.URL's
openStream() method to read a content from particular website. After I
migrated this program to J# and make some neccessary changes on the code,
I've finally successfuly compile it and run in on .NET Framework. Then, I
make t... more >>
Conversions of Structs from win32 to Dotnet
Posted by nravishankar NO[at]SPAM trianz.com at 7/25/2005 7:30:10 AM
I have a following doubts in PINVOKE. Can anybody offer help on these?
We are trying to make calls to win32 API, where we are having the
following structs and enums in win32 class.
How to convert the following in DotNet?
1)
struct Test_FOO
{
enum Type
{
Type_A = 1,
... more >>
passing list of strings to c++/stl function which modifies it.
Posted by PD at 7/24/2005 11:32:06 PM
Hi all,
I have an unmanaged DLL created using VC++ 6.0 which exports a few C++/STL
functions.
Im calling the exported function from a managed C++ DLL, created using
VS.Net 2005 beta 2.
I need to pass a string list by reference to the unmanaged function. The
unmanaged function modifies... more >>
question about how to deal with VARIANT returns from COM
Posted by Mac Dyer at 7/22/2005 5:04:22 PM
I am curious how to work with VARIANTS in C# that are returned by a COM
class via interop. I understand the interop process recognizes it as
System.Object, but how can I get say the type of the data out of the VARIANT
that is now considered a System.Object object?
Ex.
COM:
IMyInterface : ID... more >>
Error 1073741819
Posted by MICHAEL CARR at 7/22/2005 9:12:23 AM
When trying to connect to COM interface from unmanaged code I get an =
error 1073741819. The failures is intermittent, when I try to catch the =
exception it is not a _com_error. Can anyone help me out?
--=20
MICHAEL CARR... more >>
C# and vbscript
Posted by Jozsef Bekes at 7/21/2005 10:47:13 AM
Hello Everyone,
I am trying to access a C# class from vbscript. All is file, except for the
case when I want to use optional parameters or function overloading. As I
found out, optional parameters are not supported by C#, function overloading
is not supported by COM. There is an attribute:
... more >>
Calling C++/STL function from managed code
Posted by Ratan at 7/21/2005 9:39:05 AM
Hi All,
We have unmanaged DLL created using VC++ 6.0 which exports functions like
the following-
long __declspec(dllexport) TestFun(std::string filePath);
When we are calling this function from C#/.NET using Interop, we get the
exception with message "Attempting to read or write protected... more >>
How get a Callback/Event from a C#-DLL to C++??
Posted by Steini at 7/21/2005 9:30:06 AM
Hello,
I have an old C/C++ Project and implemented a C#-DLL, which fires an event.
I can call C#-Functions from C++ Assembly, but I don't know how to get a
callback from C# to C++. I followed this link to get an event-handling, but
it's only for VB/C# and not for C++/C#
http://msdn.microso... more >>
Can Excel 97 be controlled from VB.NET
Posted by gurfle NO[at]SPAM oz.net at 7/21/2005 6:58:54 AM
I have discovered that Excel 97 VBA does not support the IDTExtensibility2
interface. But passing "Me" as a parameter from Excel 97 VBA as an
Excel.Application to a COM Add-in created from VB.NET, I have been able to
give control of the calling instance of Excel 97 to the VB.NET project.
I ha... more >>
Object is no longer valid error
Posted by vsp3r at 7/21/2005 1:36:01 AM
We have a .NET application that uses ADOMD to query a MS analysis OLAP cube.
In a typical query, we get data for about 3 dimensions (800 x 15 x 2
entities) and then iterate over the resulting cell set to extract
information.
Occasionally, we see "Object is no longer valid" exceptions being th... more >>
Debug breakpoint in managed code causes application to crash
Posted by Vinay at 7/21/2005 1:34:03 AM
Hi,
I am trying to call function from Win32 DLL from C#.The DLL is written with
VC++. When I attach VS.NET IDE to running managed application for "CLR" and
"Native" mode I can debug from C# code to win32 code. But when I try to put
breakpoint in managed code after Interop call, application cr... more >>
How to find all computers connected to the network ?
Posted by Lee Gillie at 7/20/2005 12:28:47 PM
I have tried variations of using
iRet = WNetOpenEnum( _
RESOURCE_SCOPE.RESOURCE_GLOBALNET, _
RESOURCE_TYPE.RESOURCETYPE_ANY, _
0, _
nr, _
ptrHandle)
Which works well, except that it returns b... more >>
IDTExten2ibility2 OnConnection method: Can't get it to start
Posted by gurfle NO[at]SPAM oz.net at 7/20/2005 5:59:42 AM
I am new to VB.NET coding for excel, and so am probably missing
something real elementary here:
I can get an Excel 97 VBA module to successfully include a reference
to a VB.NET project that contains the Connect class with the necessary
Guid and ProgId attributes and the five IDTExtensibility2 ... more >>
Marshalling a single dimensional array of floats to/from a C DLL
Posted by johannblake NO[at]SPAM yahoo.com at 7/20/2005 2:52:17 AM
I want to pass a single dimensional float array to a method written in
C. The method modifies the values in the array and returns these. I can
also pass the C code a parameter to indicate the number of elements in
the array.
Since I am in control of the C code, I can modify the parameters to
... more >>
How to create an instance of a remote COM?
Posted by Michael Moreno at 7/20/2005 12:00:00 AM
Hello,
I cannot find how to create a COM object located on a server Machine.
Can you help please?
Thanks.
--
----
http://michael.moreno.free.fr/
... more >>
Using AxWebBrowser with credentials
Posted by Glass Half Full at 7/19/2005 2:00:21 PM
I have an application in which I'm using the AxSHDocVw.AxWebBrowser control
to navigate to a webpage. For a demo I'd like to be able to hard code some
credentials for this control to use. What is the easiest way to do this in
c#?
Thanks,
G
... more >>
Passing an array to VB6
Posted by Jeremy Chapman at 7/19/2005 1:22:46 PM
I have a method "int TestMethod(MyClass[] pMyClass);" in a class exposed as
COM and I'm trying to call it from VB6. All other methods work except for
ones with arrays. I get the error "Function or interface marked as
restricted, or the function uses an Automation type no supported in Visual ... more >>
Error 1073807364
Posted by MICHAEL CARR at 7/19/2005 10:54:02 AM
Can anyone tell what error code 1073807364 is? We get this when trying =
to connect to a .NET COM Component from unmanaged code.
--=20
MICHAEL CARR... more >>
Mixed assembly, correct usage
Posted by RYoung at 7/19/2005 4:46:43 AM
Hello,
Using C++/CLI to build a managed class library for DirectShow, and wondering
what the implications of the following would be:
void RenderFile( String^ file )
{
m_pGraph->RenderFile( (LPCWSTR)Marshal::StringToCoTaskMemUni(
file ).ToPointer(), NULL );
}
Everything works fine... more >>
Cannot load .NET COM Object into ASP (Classic) Application Object
Posted by Ken Granderson at 7/18/2005 1:42:38 PM
Hello all,
I am trying to implement some objects that need to be called from both
ASP.NET and ASP Classic.
On the ASP Classic side, the objects will be cached in the ASP Application
object.
I have built COM objects in .NET before, and have created an ASP Classic web
site that uses some o... more >>
.NET generated IDL to C++ proxy stub
Posted by Nick Wilton at 7/18/2005 12:00:00 AM
Hi all,
I have been following Amit Dey's example of ActiveX event sources and VC++
clients at codeproject.com
(http://www.codeproject.com/com/vbeventswithvc.asp#xx846270xx). My
requirement is somewhat different however, in that I have a .NET assembly
that needs to provide a COM interface to e... more >>
Need to use a Delphi dll in .NET
Posted by test at 7/18/2005 12:00:00 AM
Hi
I have a Delphi dll written by someone else, and I need to use it in my
..NET application. How do I do this?
I have very little info on the dll, basically all I have is the
following two function declarations:
function VerifyUser(DatabasePath: string; UserName, Password: string;
ou... more >>
Debugging Issue
Posted by Federico G. Babelis at 7/15/2005 10:21:52 PM
Hi:
In VB.NET 2005 Express beta 2, I cant debug my application when I insert a
breakpoint it never is reached, a message like "No debug symbols loaded,
breakpoint will likely not be hit"
Any idea ?
Thx,
Fede
... more >>
Best practice updating registry with .NET classes exposed to COM
Posted by kirill NO[at]SPAM softerra.com at 7/14/2005 9:27:29 AM
Hello,
I'm on my way from COM/ATL world to .NET/COM world and I have the
following question. I have a .NET class exposed to COM. I need some
extra data to be put to the registry when my assembly is being
registered, apart from the data set by the RegAsm.exe. In the ATL we
have wonderful .RGS ... more >>
Exception in NET component called from unmanaged code .
Posted by Serge at 7/14/2005 8:16:02 AM
Hi there !
There is a problem of calling NET assemblies from unmanaged code via COM (
NET component registered as COM one) . We have executable which calls this
COM component methods which in turn calls other NET assemblies. Some of the
calls get information from config file creating corr... more >>
Interop Works In Application, But Not In ASP
Posted by Marvin Massih at 7/13/2005 4:30:14 PM
Hello,
I want to access a COM object from .NET.
The interop wrapper works like a charm from any .NET application.
However, as soon as I try to access it from ASP I get:
"System.InvalidCastException: QueryInterface failed"
Any ideas?
Regards,
Marvin... more >>
Finding GdiPlus.dll
Posted by Mike King at 7/13/2005 4:16:53 PM
I'm trying to interop (P/Invoke) with gdiplus.dll on Windows 98 but the .NET
runtime cannot find the DLL. The DLL is on the system. If I set the
environment variable "path" to include
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322" then the runtime will find
the DLL. My question is, how ca... more >>
What library is xlLocationAsObject in for use in VB.NET?
Posted by gurfle NO[at]SPAM oz.net at 7/13/2005 12:00:00 AM
In VB.NET I imported Excel and Graph libraries,
but xlLocationAsObject is found in neither.
Where is it? Also, can anyone tell me an easy way to find out
which library contains a given name like this? (so I won't
need to bother a newsgroup about this next time!)
Thanks in advance,
|\|.... more >>
Add-in: working with Excel in c#
Posted by Glass Half Full at 7/12/2005 4:27:28 PM
I'm having a problem in developing a very simple Add-in application for
Excel.
I've tried quite a few approaches and googled quite a bit but can't get
things right.
When my Add-in menu item is selected code executes to gather input from a
user, make a remote call, acquire data and write th... more >>
c# interop question-- QueryInterface trouble
Posted by Jim Bancroft at 7/12/2005 2:05:13 PM
Hi everyone,
I've recently ported a COM component into .Net using a runtime callable
wrapper. The component in question is SQL Server's DTS package, if that
helps.
The import worked well enough....now I'm having some trouble using the
component. Specifically, this code below from VB6, ... more >>
C++ calling .NET object leaks
Posted by Scott at 7/12/2005 10:56:08 AM
I have a large VC 6.0 service that uses .NET for some of it's processing =
in an attempt to migrate to pure .NET slowly.
This service runs 24x7x365 except when it runs out of memory.=20
The culprit seems to be when I access the .NET components the =
obj->Release() does not really release the... more >>
Problem in generating .Tlb file form .NET 2005 assemblies
Posted by SSRoy at 7/12/2005 6:17:02 AM
Hi all,
The type library is an important file for COM interop, without which
unmanaged code can't interact with managed code.
When I use .NET 2003, I can sucessfully generate .tlb file from a .NET Dll
(built with /clr:oldsyntax switch) - using tlbexp or Regasm /tlb.
The above technique never... more >>
|