all groups > dotnet interop > april 2004
Filter by week: 1 2 3 4 5
Win32 Interop: Windows Installer SDK
Posted by Shane Warren at 4/30/2004 4:58:40 PM
I need to determine the ProductCode from msi (install file) using a .net
application (web service) written in C#. I found a function in the Windows
Installer SDK which seems to be what i want the function is defined as:
UINT MsiOpenDatabase(
LPCTSTR szDatabasePath,
LPCTSTR szPersist,
... more >>
System.InvalidCastException - QueryInterface Failed - error.jpg (0/1)
Posted by Tony C. at 4/30/2004 1:17:04 PM
Hi,
I have a vb6 active-x dll that I want to use in my vb.net
program. However I'm getting the above System.InvalidCastException
Query Interface faild for .....myPrintClass
I admit , I've never done interop from vb6 to vs.net before
except for other commercial com components ... more >>
Tlbimp.exe Cannot Handle Coclasses That List Source Interfaces That Are Defined in a Different Type Library (KB318466)
Posted by Naomi and Gad at 4/30/2004 11:59:28 AM
I miserably fail using TlbImp.exe to create a .Net wrapper over a COM
object.
The COM object implements a coClass for an interface defined in an external
..tlb.
Say I implement class A for interface IA, when running TlbImp it reports
that it can't load type AClass from the assembly (there is no... more >>
Opening a specific Excel worksheet in a webBrowser control
Posted by Gary at 4/30/2004 7:51:08 AM
How can I open a specific Excel worksheet in a webBrowser control using vb.net? I can open a workbook using this, I would like to select a specific worksheet.
Dim x As frmExcelDisplay = New frmExcelDispla
x.Show(
x.AxExcel.Navigate("C:\mySpreadsheet.xls"
Thank
Gary... more >>
Problems when creating an Exchange offline address book (OAB)
Posted by Benny Hest at 4/29/2004 11:38:17 PM
Hi.
I try to create an OAB with LDAP and ADSI. I set all these properties:
offLineABContainers
offLineABServer
offlineABSchedule
offlineABStyle
instanceType
doOABVersion
msExchOABFolder
legacyExchangeDN
- and still I only get an:
System.Runtime.InteropServices.COMException (0x8007... more >>
ITaskSchedler implementer DLL name for importing?
Posted by Sean Z at 4/29/2004 8:06:02 PM
Hello, where do I get the name of DLL that contains class implementing ITaskScheduler interface - I would like to import it into my C#. The class's ID is CLSID_CTaskScheduler
Thank yo
... more >>
VB.Net Web Application Crashes on Framework 1.1
Posted by Amit at 4/29/2004 4:51:04 PM
We have a VB.Net web application that works very well on Framework 1.0. This application uses pre-existing VC++ COM objects registered in COM+. Few months back the system administrator installed the Framework 1.1 and the application started crashing after few calls. Since we did not use any of 1.1 f... more >>
Problem: How to set a value to a property using IDispatch
Posted by dov_sheinker NO[at]SPAM yahoo.com (| at 4/29/2004 7:48:03 AM
Hi,
I got a problem here and would appreciate some help.
I have a System.__ComObject. I would like to get/set properties of
this COM object. I cast it to IDispatch, and using invoke() I'm able
to get properties' values.
Now I want to set a value, in order to do that, I need to set the
fiel... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
TypeLoadException & dynamic assemblies signing
Posted by Ostap Radkovskiy at 4/28/2004 3:42:39 PM
Hi!
I'm having problems with strongly named assemblies usage. There is a .NET
solution with number of projects signed by public/private key pair (snk).
The solution uses another package of .NET assemblies signed by another snk
and deployed as msi. Now the problem. These package assemblies hav... more >>
Dll and Com
Posted by Stefan at 4/28/2004 3:27:45 PM
Hi NG
I've a stupid question:
If a want use a .NET component as a com-interface I need to register my dll.
Do the clients which uses the component need the .NET framework??
Thanks
Stefan
... more >>
CCW
Posted by Mike at 4/28/2004 3:17:27 PM
I have a VB.NET Class file that I created that i need to use from a VB6
component.
I need to make a CCW to allow the VB6 to access the .NET component. How do I
make a CCW file?
In the properties of the project I have Reg as COM checked but no CCW is
created. What am I missing?
thx
... more >>
Opening .mdb file only for viewing purpose.
Posted by Suma at 4/27/2004 3:31:04 AM
H
I want to open an .mdb file for viewing purposes to the User
The User should not be able to change anything contained in that database
He should be able to only view the contents
How can I achieve this
For Word,Powerpoint and Excel, in the Open method itself we can specify whether the file i... more >>
InternetCrackURL
Posted by Dave Londeck at 4/27/2004 12:52:36 AM
Has anybody tried to use this API and if so can you point me to a working
example.
I am using vb.net.
It is always returning 0 or a failure.
... more >>
passing a delegate to a C function.
Posted by james_morris1232000 NO[at]SPAM yahoo.com.au at 4/27/2004 12:52:09 AM
I have a dll written in C. I call this C function from my C# code.
Within the C function(in dll) it should be able to call a function in
C#(Callback function). So when I call the C function I need to pass a
pointer to the C# function. I use delegates within my C# code for
other reasons, but coul... more >>
Understanding CryptoAPI "keycontainer" and "unique key container"
Posted by Michel Gallant at 4/26/2004 10:14:57 AM
A number of folks have asked me about the naming convention used for the
CryptoAPI unique keycontainer files (Microsoft CSP keycontainer files).
These are encrypted (via DPAPI in W2k+) files holding RSA or DSA keypairs
and managed by the CSPs.
While these details are evidently WinOS-specific ... more >>
Baffled: SHGetSpecialFolderLocation throws MissingMethodException on Compact Framework
Posted by Michael Senf at 4/26/2004 10:10:30 AM
Hi,
I working on a very simple prototype to intercept file system change
messages on my Pocket PC.
When I use the SHGetSpecialFolderLocation function, I get a
MissingMethodException.
What am I doing wrong? If anybody has sample code how to receive fife system
notifiations, tat would be e... more >>
Can someone Translate this
Posted by Gerry Viator at 4/26/2004 8:52:08 AM
Hi all,
Can someone translate this C++ to VB.NET
int _tmain(int argc, _TCHAR* argv[])
{
HWND hWnd = ::FindWindow("ConsoleWindowClass",NULL);//Find window
HMENU hMenu = GetSystemMenu(hWnd,FALSE);
DeleteMenu(hMenu,SC_CLOSE,MF_BYCOMMAND);
RECT rc;
::GetWindowRect(hWnd,&rc);
SetWind... more >>
slow reading of eventlog
Posted by zorro at 4/26/2004 3:21:04 AM
I need to read the entire eventlog and parse it. The application uses vb.net and the EventLog object. The problem i'm having is that it can take less then a second up to 15 seconds to read all entries in the eventlog. I used Perfmon and found the following two counters that were used heavily
..NE... more >>
WTSSetUserConfig help. Urgent!!!
Posted by Thomas Nygaard at 4/26/2004 2:11:03 AM
I am trying to call the WTSSetUserConfig function from VB.Net but it does not seem to work. I always get the error: "The user does not exist". But when I am using the function WTSQueryUserConfig to get the information i works ok.
My code is as follows
Const WTSUserConfigTerminalServerProfilePath... more >>
Passing a dotnet control as generic object problem???
Posted by nazim NO[at]SPAM ntierbusiness.com at 4/26/2004 12:45:10 AM
Hi All,
I have written a VB activex dll component, which exposes a method say
MethodA that takes one of the arguments as object (generic) type. The
method looks like this:
Public Sub MethodA(ByRef ctrl As Object, ByVal categoryID As
FontCategoriesEnum, Optional ByVal resID As Long)
When ... more >>
SetPrinter Call
Posted by Frank Jones at 4/23/2004 4:51:02 PM
We are trying to pause a printer from C# or VB code using the Win32 printer API's in the winspool.drv. We are having varying degrees of success. With the following VB code, the OpenPrinter call works, but we get an access denied error message upon calling SetPrinter. I have auditing turned on the... more >>
Is is possible to "Emit" an object that will work via Interop?
Posted by dearpolycarp NO[at]SPAM hotmail.com at 4/23/2004 10:01:26 AM
We're trying to sythetically emit an object on the fly and have it
work via COM Interop (we using scripting in our product). We can
generate the object just fine and it even kind of works, however I
need the equivalent of these attributes on the object I "Emit" and I
am unable to figure out how... more >>
AxInterop Bug?
Posted by Mike at 4/23/2004 6:37:57 AM
I'm having a strange problem and can't find a solution
anywhere. I have an ActiveX control that I added to the
toolbox. I then added it to the form with no problems and
ran the application. Everything looked good. I then
added the VC++ 6 source code as a project to my .NET
solution and... more >>
MFC COM client interop problem with arrays
Posted by Harold Guynn via .NET 247 at 4/22/2004 9:57:19 PM
I'm trying to send an array from a MFC COM client to a .NET assembly. It works fine with non-array data and with strings, but I get an error message "No such interface supported" when sending an array.
Here is the C# code:
namespace SpecTest
{
[ClassInterface(ClassInterfaceType.AutoDual)]
... more >>
Marshaling the structure array member of Structure in C#
Posted by Vini Deep via .NET 247 at 4/22/2004 9:54:24 PM
Hi,
I have a structure defined in a dll which has another structure array as a member. I need to call this Dll from C#. How do I do it?
This is the structure I have in the DLL.
typedef struct FIRST_STRUCT
{
double XSpeed;
int DRate;
unsigned int RotCtrl
} FIRST_STRUCT;
typedef stru... more >>
Disable x button of another program
Posted by Gerry Viator at 4/22/2004 12:31:48 PM
Hi all,
I want to disable the x button of an old dos based program?
I guess I will need a process running in the background ?
thanks for any help
Gerry
... more >>
RasEnumConnections
Posted by James Hancock at 4/22/2004 12:20:26 PM
I'm having problems using RasEnumConnections.
[DllImport("rasapi32.dll", CharSet=CharSet.Auto)]
public static extern int RasEnumConnections(ref RASCONN[] Connections, ref
int dwSize, out int TotalConnections);
[StructLayout(LayoutKind.Sequential, Pack=4, CharSet=CharSet.Auto)]
pub... more >>
SCardTransmit
Posted by fred at 4/22/2004 12:09:10 PM
Hello.
I try to read a smart card in win ce.net 4.0 with visual basic.net.
I use winscard.dll, the SCardEstablishContext, SCardConnect function work
fine but not SCardTransmit.
I use the scr131 smart card reader and i ve got an NotSupportedException
when i try to use this code.
my code ... more >>
Using .NET components from Perl
Posted by gzou at 4/22/2004 10:06:06 AM
I was looking for ways to use .NET components from Perl. I found there is a Perl module for .NET from a company called Datasophy Technologies (http://www.datasophy.com). Does anyone have any experience with this module? Their descirption is attached below
Thanks
gzo
dotNET for Perl is a... more >>
Does VB.NET Interop requires VB6 Runtime
Posted by Nelson Wu at 4/22/2004 10:04:30 AM
Hi
I have an Acitve DLL written in VB6, now I am planning to integrate it to my
VB.NET 2003 app via interop, it works OK,
the question is
Do I need to install VB6 runtime for the InterOp COM for the VB.NET apps
separately, or VB.NET app setup project will take care of all the necessary
runti... more >>
tlbimp and default interop assembly version numbers
Posted by pmmwap NO[at]SPAM yahoo.co.uk at 4/22/2004 5:42:24 AM
Does anyone know how tlbimp decides what version number to give to an
interop assembly it is building if you don't specify one using
/asmversion? I would have thought it might 'inherit' the version
number from the underlying COM dll being imported, but all the interop
assemblies I have built see... more >>
Problem: System.__ComObject recognition
Posted by dov_sheinker NO[at]SPAM yahoo.com (| at 4/22/2004 12:37:35 AM
Hello,
I have a problem and would appreciate help very much.
I have an application that receives instructions from a Windows script
engine.
When the windows script engine passes primitive types like string &
int, I can get them successfuly, however, when it passes more complex
structures, I ge... more >>
question for Mattias (dllimport/params)
Posted by Sean Z at 4/21/2004 5:16:02 PM
Hello Mattias, I have a related question, this time on NetScheduleJobEnum API. I get a null reference exception (even though the api call correctly set EntriesRead and TotalEntries params). Thanks again!
[DllImport("netapi32.dll", CharSet=CharSet.Unicode)
static extern uint NetScheduleJobEnu... more >>
CreateProcess - Please help.
Posted by provo1234 NO[at]SPAM hotmail.com at 4/21/2004 4:32:14 PM
Hi All,
Environment: Windows XP; Visual Studio .NET 2003 Edition
Problem: Calling CreateProcess Function from a Windows Service
Ultimate Aim: To print a pdf file using the command
AcroRd32.exe /t "c:\myfile.pdf" "\\PRINTERS\printer1" from a Windows
Service Program
I need to call th... more >>
Please help importing API (parameters)
Posted by Sean Z at 4/21/2004 4:11:04 PM
Please help with syntax importing an API into .NET, below is the signature. I am having trouble with specifying and passing parameters. Thanks
NetScheduleJobAdd
LPCWSTR Servername,
LPBYTE Buffer,
LPDWORD JobId
)
... more >>
DateTimePicker on a TabControl in a UserControl - Crash
Posted by indhu at 4/21/2004 3:55:32 PM
Hi
I have a User Control which has TabControl with 2 pages. I have
DateTimePicker Control on one of the TabPages, whenever the Calendar is
opened to change the dates it hangs.
This happens when my calling program is an MFC program(unmanaged).
But if the DateTimePicker is on the usercontro... more >>
IDispatch C# and Word
Posted by Dominic Godin at 4/21/2004 10:21:35 AM
Hi,
I have been trying to get at the WordBasic.DisableAutoMacros method with
C#.
WordBasic is passed as a _ComObject so I can't call this directly.
I have tried:
Type t = Type.GetTypeFromProgID("Word.Application.10");
object MSWord = Activator.CreateInstance(t);
object WordBasic = MS... more >>
InvalidCastException: QueryInterface for interface ... failed
Posted by Paul at 4/21/2004 8:41:01 AM
I am trying to access a managed com object created in VC6. I have created a ASP.Net form and have added a COM Reference to the project. This creates a interop.xxx.dll for the project. When I run the form I recieve an exception: InvalidCastException: QueryInterface for interface ... xxx. ... fail... more >>
Error 1928. Error registering COM+ Application
Posted by el_sid at 4/21/2004 2:46:05 AM
When we try and install our COM+ components using a client proxy from our Windows 2003 machine onto our XP machines we always get an error during installation on the client machine (see below). Now if we select the option "Save COM+ Component in 1.0 format..." when creating the client side proxy in... more >>
object to variant in parameter: ref object o
Posted by Morten Lyhr at 4/21/2004 2:41:04 AM
He
I have made a interop assemby with VS 2003 on a COM dll
I have the following problem
A Sub in the COM dll has the following signature
Sub Assign(ByVal FieldData As Variant
VS generates the following method
public void Assign(ref object FieldData
The variant can be several different ty... more >>
WebService DllImport Unable to load DLL
Posted by James Chang at 4/20/2004 4:36:06 PM
Hello
I am trying to import a dll from within a webservice. At the call of the dll function, a DllNotFoundException exception is thrown. I have tried to putting the dll in the web service directory, putting the dll in the system32 directory, specifying the full path for the DllImport function. I a... more >>
Translate VB6 to .NET
Posted by Steve at 4/20/2004 4:33:13 PM
Hi all
Could some-one please tell me what the equivilent .NET code is for the
CopyMemory API call?
This is my vb6 code (some code ommitted):
-------------------------------------
Private Structure FILE_INFO_3
Dim fi3_id As Integer
Dim fi3_permissions As Integer
Dim fi3_num_locks As... more >>
Adam Nathan's new P/Invoke Wiki
Posted by Sam Gentile [MVP - C#/.NET] at 4/20/2004 1:30:04 PM
This is of huge interest to this group....
The main man of Interop, Adam Nathan, has put together a Wiki for Win32
P/Invoke signtaures. This is a valuable contribution to the Interop
community.
http://pinvoke.net/
PINVOKE.NET attempts to address the difficulty of calling Win32 or other
unman... more >>
VB6 into .Net into VB6
Posted by John Dough at 4/20/2004 11:24:55 AM
Hi,
We currently have a legacy VB6 app which we want to gradually convert into
VB.Net. We have been told its better to make calls from .Net to COM than
vice versa, so the intention is to start by rewriting the screens in the
order in which they are called, gradually shifting them from VB6 into... more >>
QueryInterface for interface xxx.yyy failed
Posted by Chris at 4/20/2004 6:21:07 AM
Hi everyone
We are trying to access a remote COM object in our asp.net application and are running into difficulties. We keep receiving the error: QueryInterface for interface "dll.className" failed. This error occurred when we deployed the application to our test servers. During our development c... more >>
AllocHGlobal Problem: "The object is currently in use elsewhere"
Posted by Jesse Ezell at 4/19/2004 4:01:06 PM
When trying to free memory allocated with Marshal.AllocHGlobal, I get the message
"The object is currently in use elsewhere
Any idea why or how I can fix this? Sample code below
int bufferSize = GetGlyphOutline(hdc, (int)c, (int)METRICSFORMAT.GGO_NATIVE, out metrics, 0, IntPtr.Zero, matrix)
I... more >>
Problems with interop
Posted by Gasman at 4/19/2004 1:40:13 PM
Hello all, i am having a problem with a dll vb6 file. i'm programing a =
nt service using vb.net with visual studio.net.
The problem be when i use the final service, because when i debug it, =
all works fine. But when i run the service in the service manager never, =
execute a vb6 dll method.
S... more >>
Duplicating a socket for another process
Posted by Brad Radaker at 4/19/2004 1:01:03 PM
I am needing to write a socket server in c# that will essentially dupe each socket handle from the process that receives the connections to separate processes that will handle each connection from that point on (one process per connection). This is so that if the process handling one of the connecti... more >>
Arrays of float passed by ref
Posted by gax700 at 4/19/2004 9:52:39 AM
I'm currently porting a working VB6 application in Visual c# but I'm having
big troubles converting this external function call to a Fortran DLL. I
think the problem is about passing arrays by reference as arguments.
The VB6 version is
Declare Sub CALC Lib "CALC32.DLL" (ByRef V1 As Single,... more >>
Error while adding Class to COM+ using regsvcs .NET1.1
Posted by ravi_jon NO[at]SPAM hotmail.com at 4/19/2004 7:39:59 AM
Hi,
I am having a strange problem when trying to register .NET DLL to
COM+. I am using .NET framework 1.1. The DLL I created works fine
through ASP.NET pages when I import the Class.
But I want to register it under COM+ Services. I did the following:
1) Assigned Strong Name
2) I ad... more >>
|