Thanks for your reply. I solved it like this:
class CDllProblemApp...
{
...
MyClass myInstance;
...
};
double _stdcall MyExportedMethod(double param)
{
theApp.myInstance.MethodIwouldLikeToInvoke();
return 0;
}
I am trying to communicate (send and receive ASCII-characters) with a USB-barcode printer. In order to get a handle to the device I believe I have to call CreateFile and it has the following prototype:
HANDLE WINAPI CreateFile(
__in LPCTSTR lpFileName,
__in DWORD dwDesiredAccess...
Please see the lower part of my 28 Nov 07 4:13 post. If nobody comes up with a better suggestion, then I will use the appropriate events generated by all components on my form instead.
Thanks for your suggestions. However, I would prefer to let the user freely switch between accessing the Excel sheet directly and accessing the user form, without having to push any buttons. Whenever the user wants to switch from accessing the Excel sheet to accessing the user form, he/she...
No, UserForm_gotFocus() does not exist, I just used it in my previous post to easily explain what I needed. If the _gotFocus() sub routine existed, I wouldn't have started this thread.
Thanks for your replies.
----------------------------------------------------------
nickdel:
I have a user form with a textbox (among other components) in Excel. The user form is modeless so the user can switch between accessing the Excel sheet and the user form. Whenever the user form is...
I have created a dll in MFC using the Visual Studio wizard and the dll exports a function called MyExportedMethod:
#include "stdafx.h"
#include "DllProblem.h"
BEGIN_MESSAGE_MAP(CDllProblemApp, CWinApp)
END_MESSAGE_MAP()
CDllProblemApp::CDllProblemApp()
{
}
CDllProblemApp theApp;
BOOL...
Found the solution:
http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.windowsforms/topic12117.aspx
In order to make it work with Excel I made the following change:
New code:
IntPtr hwnd = Win32.FindWindow("XLMAIN", null);
Old code:
IntPtr hwnd = Win32.FindWindow("OpusApp"...
I have created a Shared Office add-in for Excel. The add-in works great and in my C# code I create a Windows Form (System.Windows.Forms.Form). Can I make this Form be a child of the Excel window itself? Basically, I want to make sure the dialog is always on top of the Excel window.
Thanks for replying. I will try to clarify a bit. I used the following example as my starting point for the ActiveX component and it is still in progress:
http://www.codeguru.com/cpp/com-tech/activex/controls/article.php/c5517/
I'm not sure if it is a COM component or not, the .ocx file gets...
I would like to write a very simple custom ActiveX component with one button and one checkbox on it. I will put this ActiveX component into a user form in an Excel macro and I want this ActiveX component to communicate (invoke methods and generate events) with the VBA code that embeds it, based...
I have written a custom ActiveX component and I inserted it into a user from in Excel. How do I go about to invoke methods that the ActiveX component exports? Also, how do I subscribe to events from the ActiveX component? If anybody could refer me to an online tutorial or provide snippets of...
I would like to write an ActiveX component in C#. I followed the following instructions:
http://www.codeproject.com/cs/miscctrl/exposingdotnetcontrols.asp
When I test this ActiveX component using tstcon32.exe, the component runs fine, with the exception that nothing happens when I invoke the...
Thanks! I can't believe it was that simple to export a method. I found out that the events works like this:
using System;
namespace EventExample
{
public delegate void EventHappenedDelegate(Double dValue);
public class MyClass
{
public event EventHappenedDelegate...
I have created a custom made .NET Component (in Visual Studio .NET 2003) that contains a regular button and a checkbox. I build a .dll file and then use the .NET Component in a LabVIEW application. In LabVIEW I can get a long list of methods that the .NET Component supports (BeginInvoke(Delegate...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.