|
This simple class gives a compiler error under Microsoft Visual C++ .NET (7.1.3088) ...
error C2653: 'n1System' : is not a class or namespace name
error C2143: syntax error : missing ',' before '*'
#pragma once
#using <mscorlib.dll>
using namespace System;
__gc class test
{
public:
__delegate int MyDelegate(String *str, Int32 *n1, Int32 *n2);
test(void);
~test(void);
};
but compiles fine with only one Int32 declared in the _delegate
__delegate int MyDelegate(String *str, Int32 *n1);
Any ideas?
Mike
|
|
|
|
|
MSDN[^] says that the declaration of the Delegate should be outside the class? anything to do with that, coz i have no idea about VC.net
-prakash
|
|
|
|
|
But why is it ok with two arguments, but not with three?
Mike
www.dogsleap.com
|
|
|
|
|
No I don't try this, but you gave me the clue to my problem. I must try to transform a Cbutton and not a static. Thanks a lot. I'll need it in a bigger context so "transformation" is necessary. Now it works perfectly.
|
|
|
|
|
Does anyone know how to programmaticaly get IP address of network printers ? For the moment, the only solution I got is to get them when the port is given this way : IP_XXX.XXX.XXX.XXX. But in the other cases, is it possible to retrieve this IP address ?
Best regards
Sylvaine
|
|
|
|
|
If you know the name of the printer, can you use gethostbyname() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
The problem is that I only know the share name of the printer that is not always the netbios name.
|
|
|
|
|
Could anyone tell me how to create a group box at runtime or modifying an existing CStatic member to a group box. I tried to create a group box and a static on a dialog. Now I used m_CtrlGroupBox.GetExStyle and GetStyle.
These gotten styles I set to the static member via
m_CtrlStatic.ModifyStyleEx(0,GroupBoxExStyle);
m_ControlList[Zeile]->ModifyStyle(0,GroupBoxStyle).
Static doesn't "transform" to group box. I saw a black border around now and label text in this border. Does anybody know how to do it?
Thanks
Marco
|
|
|
|
|
MarcoNedwig wrote:
Could anyone tell me how to create a group box at runtime...
Have you tried:
CreateWindow("BUTTON", ..., BS_GROUPBOX, ...);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
does anybody have any idea how to copy the bitmap content of a CPictureHolder object to a CBitmap object?
Thanks in advance!
Aristotel
|
|
|
|
|
IPicture::get_Handle() or Render().
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi All,
I converted a dll to support unicode (by defining _UNICODE, UNICODE flags; using TCHAR , etc.). Now it is not getting registered saying 'LoadLibrary("x:\xyz\FileName.dll") Failed - the specified procedure could not be found'
Please help...
Sanjay Patel
sanjayakumar.patel@scandent.com
|
|
|
|
|
What about:
LoadLibrary(L"x:\\xyz\\FileName.dll");
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I ran Depends.exe to check version of my dependencies. It works..
|
|
|
|
|
I'm working on a .NET C# application which calls an unmanaged DLL (written in C/C++) which interfaces with a 1553 network to read and send data to a 1553 bus controller. This means that my application is hard to test on my regular desktop since it doesn't have the needed network hardware to actually send or receive data. Furthermore even if it had the hardware, setting up a test with the appropriate network traffic is very difficult (though we do have specialized lab facilities that can do it -- heavily scheduled facilities). My objective is to run complex, challenging, realistic tests of my application on my desktop.
My thought was to create an unmanaged DLL in .NET which could "pretend" to be the network DLL and feed data to my application in the same way the real DLL would. This sounds good in principle but I haven't quite managed it yet. With some help from the internet newsgroup, I managed to create a VC++ unmanaged DLL which when created looks like the network DLL to my application. David Browne on microsoft.public.dotnet.languages.csharp provided the following instructions for me:
Visual Studio > New Project > Visual C++ Projects > Win32 Projects > Win32
Project
Brings up the "Win32 Application Wizard"
Change Application Settings > Application Type
Choose ApplicationType: DLL and Additional Options: Export Symbols
That will create a skeleton of an unmanaged DLL. In the [appname].h file
are the exports for the application, with examples of exporting a class,
variable and a function.
This actually worked great. Now however, what I'm trying to do is to do something useful within that C++ unmanaged library.
There are no doubt many approaches that could be used for this. One might be to have the unmanaged DLL read a file that contains a "scenario" of network messages. Unfortunately, the usual XML processing classes don't seem to be available, probably because they are "managed" and available only through the CLR. The question is what to do about that? I get the hint from reading some of these postings that I might be able to eventually overcome that limitation by creating some C# app doing what I need and calling it from the C++ but that seems complicated. Is there a better way to read this scenario file? Am I better off just reading it as text and doing my own parsing? I'm pretty new to the sophisticated parts of .NET so I thought I'd ask for some advice. Thanks.
David W. Griffin
Lockheed Martin Aeronautics Company
|
|
|
|
|
The unmanaged DLL could use MSXML to read the XML, either using DOM or SAX as appropriate, or use something like tinyXML instead...
Steve S
Developer for hire
|
|
|
|
|
Thanks, but I guess I'm more ignorant than I thought. Could you give me a one line definition of MSXML, DOM, and SAX and give me perhaps a pointer to where I might find an example to use to try these methods? And perhaps some guidance as to what the advantages to each approach are so I can determine which to try first?
|
|
|
|
|
Thanks, but I guess I'm more ignorant than I thought. Could you give me a one line definition of MSXML, DOM, and SAX and give me perhaps a pointer to where I might find an example to use to try these methods? And perhaps some guidance as to what the advantages to each approach are so I can determine which to try first?
David W. Griffin
Lockheed Martin Aeronautics Company
|
|
|
|
|
Is there a good article or can anyone explain shortkeys?
I have implemented an accelerator resource in our dll. I added an event handler in a class and thought (wrong that if the dialog, which the class implements, would handle the shortcutkey event, but nope.
The dialog has an OK button which is disabled until a choice (of 2 radiobuttons) is made. The shortcut keys would be a "faster" way of doing this...
So what am I doing wrong? (I also tried onkeydown and stuff...)
tnx for your help!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Just for clarification, are you referring to mnemonics?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You mean the & in menu's and controls? Nope, I mean an extra resource ACCELERATOR which maps shortcut keys to events like CTRL+K, CTRL+D,...
I already tried the mnemonics, but it didn't work. (Too be honest, I think there's something wrong with the dialog, there are several mnemonics defined, but only 1 seels to work.)
(I have no idea who created that dialog btw )
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I'm not sure if it's what you want, but I recently saw a similar article by Nish on www.voidnish.com. This is a program to make global shortcut keys, if that's what you want - so you could look at that source code. If you just want the keys to work for your application, override the PreTranslateMessage() function in your dialog and use GetAsyncKeyState() to check for the keys you need to watch for.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
I did it thanks.
(i put together all info from CP and MSDN and finally it worked )
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I did it via PreTranslatMessage...
(the code I found on MSDN didn't seem to work for me, but now it works jeej )
tnx!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Easy question i think. I want to implement a custom control that contains an image, two radio buttons, and a combo box. I have two ways in my mind (or maybe 3 if i consider the ActiveX case...):
1) Use the resource editor and create a borderless dialog with these controls and then attach multiple instances in a dialog box using create method
or
2) Create a new class extending, say CWnd that dynamically adds these controls.
What is correct way (in the sence: what the "professionals" do)?
I have implement the first way successfully but i don't know if is the right technique...
Thanks.
|
|
|
|