all groups > dotnet interop > february 2006
Filter by week: 1 2 3 4
Visual Studio ActiveX import
Posted by Charley at 2/28/2006 8:48:42 PM
Hello,
I'm trying to use an ActiveX object from a c# project in Visual Studio 2005.
I don't understand the difference between adding the .ocx file as a
reference and adding the .ocx file to the toolbox then dropping it on a
form. I can only get functionality working if I add it through the... more >>
Repace doesn't work under Windows 98
Posted by Gregory Khrapunovich at 2/28/2006 6:23:00 PM
I am using Visual Studio 2003 (Framework 1.1) with Windows Forms/C#. At
some point my application executes a simple statement:
string filename = Application.ExecutablePath.Replace(".exe", ".xml");
When I tested the applications under three different operating systems, it
turned out that t... more >>
Posible ServiceBase sample error
Posted by Yanko at 2/28/2006 2:50:34 PM
Hi guys/gals
I'm not versed at all using p/invoke so I don't know how to fix
this:
Given this declarations:
/**************************************/
typedef struct _SERVICE_STATUS {
DWORD dwServiceType;
DWORD dwCurrentState;
DWORD dwControlsAccepted;
DWORD dwWin32ExitCode;
DW... more >>
Insufficient memory to continue the execution of the program.
Posted by lyang at 2/28/2006 11:20:46 AM
I am converting one vs.net 2003 solution to vs.net 2005. The solution
uses one old COM component through Interop. After migration, when I
call the Interop wrapper for the old COM component, I got the following
error message:
Insufficient memory to continue the execution of the program.
I re... more >>
Unmanaged C++ Shell Extension Handler as client to C# COM Object
Posted by gilad at 2/28/2006 11:00:31 AM
Hi, I am trying to get an unmanaged C++ Shell Extension Handler to act
as a COM client to a C# COM object. Since it is recommended to not do
managed Shell Extension Handlers--
http://blogs.msdn.com/junfeng/archive/2005/11/18/494572.aspx
--and since I prefer to program as much in C# as I can,... more >>
Unwrap returns VT_RECORD instead of VT_DISPATCH??
Posted by dnebeker at 2/27/2006 9:31:27 PM
I have a simple managed C++ class that I want to call from unmanaged C++.
Because of DLL Hell, etc I don't want to register it with COM (multiple apps
will use this DLL), and because of the mixed-mode deadlock/loader lock I
can't just export a function and call it (I'm using .NET 1.1).
Tha... more >>
Mixed Assembly Interop
Posted by MichaelG at 2/27/2006 12:42:17 PM
Is it possible to do interop in a mixed assembly in VS2005?
I have an ATL COM object which I want to create and call from a managed
class.
Something like this:-
// ManagedClass.cpp - compile with /clr
#include "NativeATLComObject.h" // compiled without /clr
public ref class Man... more >>
Looping thru collection works in VS2005, not IIS
Posted by Jeff at 2/27/2006 4:14:58 AM
This code works in the VS2005 IDE using the built in web server,
however when I run it on the same machine thru IIS it throws an error.
It's suppose to loop thru all the task in a Microsoft Project file
using C#.
object oAP = objProj.ActiveProject;
object prjTa... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Returning binary data from .Net class to through COM
Posted by Jeremy Lloyd at 2/26/2006 8:26:28 PM
Hi
I would be grateful if someone could point me in the right direction.
I have a COM callable class. In that class I have binary data in a
MemoryStream. How do I return that binary data to the caller? The calling
language is VBS.
Many thanks
Jeremy
... more >>
Retrieving Desktop Icon Positions
Posted by avec.fromage NO[at]SPAM blueyonder.co.uk at 2/26/2006 7:52:16 AM
Hi,
I'd like to be able to read the positions of all the Icons on my WinXP
desktop. I've had a look around to see how to do it and I've come up
with the code below...but it doesn't work. :o(
The x and y properties of my POINT structure are always zero. It seems
the structure isn't gettin... more >>
Loadind freeing reloading an unmanaged dll in c# code
Posted by antoine at 2/24/2006 2:14:12 PM
Hello,
In a managed application (c#) , I load an unmanaged dll (c++), but
during the execution I need to re-init the dll many times, so I tried to
free
the unmanaged dll and reload it after, it seems to work only one time ,
has anyone an explication about potential side effects? let see the ... more >>
PInvok'ing methods with LPCTSTR parametesr
Posted by Ines at 2/24/2006 1:51:58 PM
Hey everyone,
I am running into a problem PInvoking a particular method I expose in a
DLL, that basically configures and starts an ETW session
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/consuming_events.asp).
The basic method looks like this:
__declspec... more >>
Implementing IActiveScriptSite and IActiveScriptSiteWindow in VB.N
Posted by GeorgeGilbot at 2/24/2006 9:01:28 AM
I am writing a script host in VB.NET by implementing hand written
IActiveScriptSite and IActiveScriptSiteWindow interfaces on a class.
IActiveScriptSite methods are called successfully by a VBScript engine,
however IActiveScriptSiteWindow methods aren't. The consequence of this is
that VBSc... more >>
embedding a type library inside an assembly
Posted by John H at 2/24/2006 8:51:57 AM
Hi,
I deploy .net enterorise servcies dll's to com+ use regsvcs.
How can i do it such that i embedd the type lib into the dll.
I saw /extlb switch but it doesn't take a path?
Regards
John
... more >>
Marshaling char *... HELP, PLEASE!
Posted by Alvaro Enriquez de Luna at 2/24/2006 4:42:17 AM
Hello.
I have a DLL written in C. In this DLL i need a function to modify a
char * passed from a C# program inside a struct. I have reduced the
code to only one struct with one char *, but when i try to call the
funcion, i obtain this exception:
"Cannot marshal field 'str' of type 'memmap': I... more >>
Late binding equivalent
Posted by John at 2/24/2006 1:34:42 AM
Hi
What is the late binding equivalent of the below code?
Many Thanks
Regards
Dim O As Outlook.Application
Dim F As Outlook.MAPIFolder
Dim iCon As Outlook.ContactItem
Dim oContact As Outlook.ContactItem
O = New Outlook.Application
F =
O.Session.GetD... more >>
Overload of Excel Copy from C#
Posted by Oliver Bock at 2/24/2006 12:00:00 AM
According to the Excel manual, there are three variants of the Copy()
method that applies to Chart objects (and others):
Syntax 1: expression.Copy - copied to clipboard
Syntax 2: expression.Copy(Destination) - copies range
Syntax 3: expression.Copy(Before, After) - duplicates... more >>
COM+ LC Event - Transient Subscription (New Issue)
Posted by Blair Allen Stark at 2/23/2006 9:43:27 PM
well I am making progress. . .
Here is where I was going with this. . .
I want an ASP.NET application to fire the event. I want users to be able to
run an app and get a real-time view of certain activities.
with these set in the COM+ Event Class assembly:
<Assembly: ApplicationActivati... more >>
Distributing IAs for Word 2000
Posted by Evan Stone at 2/23/2006 3:53:57 PM
We're having some confusion regarding whether it's legal to generate and
distribute IAs for Office 2000. We would be only deploying them to our
application directory since we want to support XCopy deployment, and the
information up on the Microsoft and MSDN sites is rather... indirect, and
also ... more >>
Late Bound Access to NormalTemplate.Saved property in Word (C#)
Posted by Evan Stone at 2/23/2006 3:22:47 PM
Hi,
How would one go about accessing the Application.NormalTemplate.Saved
property in Word via C# and LATE bound?
I'm currently getting the infamous "do you want to save Normal.dot" error on
certain systems from the following code (it seems to be from fresh
installations of Word, since some... more >>
Threads frozen when using CorBindToRuntimeEx
Posted by dnebeker at 2/23/2006 8:33:20 AM
Sorry, this one is complicated.
I have a normal (completely non-Managed C) C++ app that uses MFC. This app
calls:
CorBindToRuntimeEx(L"v1.1.4322", NULL,
STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN, CLSID_CorRuntimeHost,
IID_ICorRuntimeHost, &ppv);
Once started, it does a LoadLibrary on ... more >>
Native event in C#
Posted by Benny Tops at 2/23/2006 2:13:10 AM
Hi guys,
I'm having a hard time to subscribe to a native event in C#.NET. The
application I'm writing should be able to detect changes in DHCP
parameters. This is done through the following:
DWORD APIENTRY DhcpRegisterParamChange(
DWORD Flags,
LPVOID Reserved,
LPWSTR AdapterName,
... more >>
Interop to C
Posted by mortb at 2/23/2006 12:00:00 AM
Hi!
I'd llike to encapsulate a C function with signature:
char * foo(char * bar)
How would I call this function and how do I free the memory pointer which is
returned?
TIA!
mortb
... more >>
ComException when trying to call Excel.Workbook.SaveAs
Posted by Calvin Willman at 2/22/2006 11:53:58 AM
Hi,
I'm getting the above Exception when trying to call SaveAs() on a Wb, I've
got open. I can call Save() no problem, but wanted to set Filename, etc...
Very new to programming Excel with C#, so not sure what this is about.
Can anyone help.
This is the line causing Exception.
I defi... more >>
Connection Point from MTA to vb.Net
Posted by S Wheeler at 2/22/2006 11:05:53 AM
Hi All -
Have a little problem that I hope someone can help with.
I have a MT com .exe app that fires events (connection points) from a worker
thread which is a COM MTA. It has been working fine with a VB 6 client. I am
trying to port the client to VB.net but I am having problems. The event wi... more >>
Interop properties are prefixed with get_ and set_?
Posted by TDC at 2/22/2006 5:29:22 AM
The C# app consuming this Interop Assembly sees (for example) the
read/write property Field as get_Field and set_Field. Is this normal?
Here is the snippet from the interop assembly:
<ComImport(), TypeLibType(4304),
Guid("3D1A1824-7FE5-46B8-810A-85BC59BD95D3")> _
Public Interface tkResultR... more >>
Registering VB2005 Class Library For COM
Posted by Jonathan Wareham at 2/21/2006 11:46:10 PM
Hi,
I am new to VS2005 having moved straight from VB6. I need to create a
VB2005 class library that is exposed to COM but am not having much luck. I
have set 'Make assembly COM-Visible' in the Application->Assembly
Information properties, and set 'COM Class' = True and 'COM Visible' = Tru... more >>
VB & WinAPI/Win32 functions and structs
Posted by Ted Lyngmo at 2/21/2006 10:27:22 PM
Hi!
I'm trying to find out how to avoid having to manually declare all of
the WinAPI C functions and structs before using them in VB.NET.
I'm getting familiar with VB.NET 2005 and thought I should start by
doing a copy of a little program I made in C++ years ago. That program
used a lot ... more >>
Debug from ASP into .NET assembly?
Posted by Zoe Hart at 2/21/2006 4:29:37 PM
Is it possible to debug from an ASP page into a .NET assembly it's calling
through COM interop?
Thanks,
Zoe
... more >>
DllImport for DeleteProfile results in the parmeter is incorrect
Posted by Chris Martinez at 2/21/2006 10:35:43 AM
Anyone that has an idea of how to invoke the DeleteProfile function
from UserEnv.dll through P/Invoke is greatly appreciated. I cannot see
to find any example anywhere on the web of how to import this function.
Based on the original C prototype it seems like it should be very easy
to import, ... more >>
How to do m_spPlayer->QueryInterface(&spSyncServices); on C#
Posted by Artur H. Shamsutdinov at 2/21/2006 6:59:28 AM
In Windows Media SDK Help to initialize IWMPSyncServices we using
m_spPlayer->QueryInterface(&spSyncServices);
But how can initialize IWMPSyncServices in C#. I tried to do in such way
IWMPSyncServices ss = (IWMPSyncServices)Player; but ss comes null.
How to do?
Thanks! ... more >>
DCOM Delegation
Posted by Jeremy at 2/21/2006 6:55:27 AM
I'm using .NET 2.0 and have a remoted class hosted in IIS 6 that is
attempting to access a DCOM'd object running on a Windows Server 2003 SP1
machine.
Windows Integrated authentication is enabled in IIS and I have verified that
Kerberos is enabled and working. Additionally, I have verified ... more >>
Casting of IStream to UCOMIStream fails
Posted by PRASENJIT BURMAN at 2/21/2006 12:00:00 AM
I have an application where I need to pass the data in a COLEStreamFile
object to a method of a .Net class which accepts Stream*. I had implemented
the solution specified in the following article in my application
http://support.microsoft.com/default.aspx?scid=kb;en-us;321340
But it doesn't ... more >>
How to create Interop...dll's using tlbimp.exe like Visual studio
Posted by Dean at 2/20/2006 9:01:27 PM
I am trying to automate a build. We first build COM dll's, register them,
then we want to create interop dlls so we can use them in .NET (v1.1). When
we add a reference to a COM dll in Visual Studio, we get a series of interop
dlls named: Interop.iboSubscription.dll, Interop.iboContentManag... more >>
MSDTC, Transaction, Context and Threads
Posted by Gian Paolo Clarici at 2/20/2006 3:32:40 PM
I've a problem using multithreading and MTS.
I'm using framework 1.1
Basically I want, from the Main Thread , to start a (distributed)
transaction.
then I want to start 2 new threads to perform some Database operations, each
thread will do some work on the DB using its own SQLConnection.
I w... more >>
Question about coding against a COM server in C#
Posted by jacqueline.portier NO[at]SPAM gmail.com at 2/18/2006 8:22:59 AM
Goodafternoon,
This is probably a silly question, but it is my mind all the time. In
the meanwhile i'm using VB6.
I'm using a Financial Application which you can register as a COM
server.
And then, in Visual Basic, you just go:
Set objFinApp = CreateObject("FinApp.application")
objFinApp... more >>
COM+ LC Event - Transient Subscription
Posted by Blair Allen Stark at 2/18/2006 2:11:27 AM
I am getting "An event was unable to invoke any of the subscribers (Exception
from HRESULT: 0x80040201)" on what appears to have been a properly subscribed
transient event.
I have an Event Class in a signed library, LceEvent.dll, registered in COM+
via
regsvcs LceEvent.dll
... more >>
VB6 Class to VB.NET - HELP
Posted by martins at 2/18/2006 12:23:37 AM
hi,
I found a good VB6 class to parse VBS IFO Files from a DVD movie....
here :
http://forum.doom9.org/showthread.php?t=50552
I tried to convert it to VB.NET....I made more than a half of the work...but
I'm stuck
here is my conversion :
http://pwp.netcabo.pt/falmartins/vb_net_cls... more >>
Looping memory array in C#
Posted by Totto at 2/17/2006 5:56:42 PM
Hi all,
I'm calling a win32 function from C# that returns a far pointer to an array
of data.
The looping in C goes like this:
pSint8 = (char* )pData;
pSint16 = (Int16*)pData;
pSint32 = (Int32*)pData;
pFloat = (float*)pData;
for (j = 0 ; j < numb ; j++)
{
switch (DataType)
{
... more >>
tabontrol scroll buttons
Posted by at 2/17/2006 5:00:57 PM
Hi NG!
Is there any way to get a hand on the scroll buttons of the TabControl,
those that appear at the right of the TabPage headers when there is not
enough room and the Multiline property is set to false? How to change the
aspect of these buttons?
Thanks in advance.
pax ... more >>
How to achieve isolation of an un-threadsafe COM DLL used from .NE
Posted by Shahid Hasan Faruqi at 2/17/2006 3:45:27 PM
Greetings,
I am using a third party COM DLL which is not thread safe. I need to be able
to make several instances of objects in that DLL using threads from an
ASP.NET application without getting deadlocks/problems.
I tried using Application Domains but still got thread deadlocks. Then I
... more >>
COM Interop timeout
Posted by Søren M. Olesen at 2/17/2006 12:00:00 AM
Hi
I'm working on an application, which calls Photoshop from .NET using
Interop. Sometimes however, an error occur and Photoshop displays a
Dialogbox, waiting for the user to take action, before the program
continues.
Is there a way to setup some kind of timeout on a Interop method cal... more >>
Native method returns Array of structures containing char*...
Posted by Lionel Reyero at 2/16/2006 2:02:29 PM
Hi,
I have a written a DLL in C myself, and I want to use it in my C# app using
P/Invoke.
Two functions are returning an array of structures which are containing a
"char[]" field of known size.
I tried to write a P/Invoke code in C#. but I get an error when I run the
application...
... more >>
Domain/User to LDAP NameTranslate ability in the 2.0 framework???
Posted by Dave Kolb at 2/16/2006 12:28:54 PM
Is there any new 2.0 class that offers the functionality of the ActiveDS
NameTranslate function as below? I would like to not have to use COM interop
to do this.
Thanks,
Dave Kolb
// convert the Netbios style "domain\user" name to an LDAP DN format
ActiveDs.NameTranslate nt = new Activ... more >>
COM ActiveDS warnings just referencing
Posted by Dave Kolb at 2/16/2006 12:26:01 PM
If you create a new VS.Net 2005 Windows application, add no code at all, but
add a reference to the COM "ActiveDS Type Library" and "rebuild all" more
than once you get 39 warning messages. I have found no workaround for this
and it affects my project I am converting from VS.Net 2003 to the 20... more >>
CCmdTarget destructor asserts while destroying sink object...
Posted by seek help at 2/16/2006 11:54:40 AM
Hello,
I have an MC++ class exposing a COM interface ISrv. MC++ class also has a
source interface, ISrc.
ISrv has below method:
void AttachSink( [MarshalAs(UnManagedType::IUnknown)]Object* pSrcUnk,
Int32 *pError, Int32* pState);
I have MFC sink class (derived from CCmdTarget) and imple... more >>
ProgIdAttribute being ignored on Com-visible classes
Posted by Mike Clayton at 2/16/2006 11:09:28 AM
Hi,
I'm in the middle of a project to write some COM-visible classes in a .Net
dll but I'm having problems getting a particular class to expose the correct
name.
The issue is that I've got two identically named classes in different
namespaces inside a single project. Even though only one... more >>
Urgent: Excel 2003 and ASP.NET 2.0 interop fails at runtime
Posted by AL at 2/16/2006 8:11:27 AM
Hi
I'm using a simple wrapper class which I orginally developed with .NET 1.1.
I've recently added it to a .NET 2.0 class library which is then referenced
from an ASP.NET 2.0 "project"
Although the code compiles without any problem, I get the following
exception message when creating a ... more >>
How does the TLB file work?
Posted by Barb at 2/16/2006 6:23:55 AM
I'm still trying to get my .NET .dll recognized by my VB6 COM object on the
web server. It worked on a different web server, but I can't remember all of
the steps we did to get it working there, and obviously I've missed one on
the new server.
I copied the .NET dll to the directory where m... more >>
Problem with ActiveX UserControl event mechanism
Posted by Vladislav at 2/16/2006 3:39:50 AM
I wrote an ActiveX UserControl in C# language. My problem is write a
Managed Server as the event source and for example write a COM Client
as the event sink. The managed server declares SampleEvents as an event
sink interface and connects the interface to the SampleControl class.
The unmanaged c... more >>
|