|
Using VS2005, if I was to run NOTEPAD.EXE from within an application - how would this be achieved ?
Pete
|
|
|
|
|
Can anyone tell me how I make an application run like a service(to start with windows,do not have a bar in the tool box like whe you enter My Computer) please
|
|
|
|
|
Is this a Turbo C++ or a native C++ question? If yes, you are in the wrong forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
How do you make an app to like a windows app(the blue title bar) I've tried to find over the internet but no luck:
|
|
|
|
|
Is your question related to Turbo C++ (You asked a similar question in the C++ forum) or to C++/CLI which is a managed version of C++ for .NET?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
using namespace System::Text::RegularExpression;
if (!Regex::IsMatch("[a-zA-Z0-9]{4,13]"))
{
MessageBox::Show("Username must be at least 4 char long, it can contain letters and numbers. Maximum lneght is 13 char");
}
Error 1 error C2352: 'System::Text::RegularExpressions::Regex::IsMatch' : illegal call of non-static member function c:\projects\cddvdorganizer\cddvdorganizer\frmAddUser.h 281
How can i avoid this problem.
Thanks in advance
|
|
|
|
|
The error message gave you the answer! Regex::IsMatch is not static. You have to create an instance of Regex first.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
George L. Jackson wrote: The error message gave you the answer! Regex::IsMatch is not static. You have to create an instance of Regex first.
No i don't need to create static. I yust found an error. IsMatch uses 2 parameters. Code belove works fine
if (Regex::IsMatch(txtUserName->Text, "[a-zA-Z0-9]{4,13}") == false)
|
|
|
|
|
My bad! I just noticed that IsMatch has four overloads. Two of them are static.
George
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Dear Friends..Can any one tell me about operator ":"
|
|
|
|
|
You cam use ":" with "?". In the following example, the "?" can be interpreted as "then" and the ":" as else.
int result = i > 10 ? 9 : 11;
This is equivalent to:
<br />
if (i > 10)<br />
result = 9;<br />
else<br />
result = 11;<br />
The ":" is also used with "public", "private" and "protected" to define security access within a class and inheritance.
<br />
clas Derived : public Base<br />
{<br />
public:<br />
protected:<br />
private:<br />
};<br />
You also use it to create a constructor initialize list in classes:
<br />
class Foo<br />
{<br />
public:<br />
Foo() : value(1) {}<br />
protected:<br />
private:<br />
int value;<br />
};<br />
George
|
|
|
|
|
the operator : doesn't exist
|
|
|
|
|
":" is not an operator by itself but in combination with "?" as a conditional operator "?:".
-- modified at 20:54 Sunday 10th December, 2006
-- modified at 20:54 Sunday 10th December, 2006
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
that's why i said that operator : doesn't exist
moreover, : appears in other situations, like classes inheriting in class definitions, construction list in class constructors definitions, etc...
but still this is not an operator per se.
|
|
|
|
|
I never said it was an operator. I just demonstrated its usage, and you explicited stated it was not an operator and restated my previous post.
Also, I believe the ":" falls under the category of punctuation. Punctuation and operators are lexemes.
Nevertheless, I appreciate your comments and hope we didn't confuse anyone.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hello,
I'm trying to accomplish the following:
A C++ dll project, which uses another dll (which I didn't write).
My project would contain certain unmanaged functions, and then a managed class to encapsulate those functions.
I'm new to C++.NET, and especially to the mixed projects stuff, so after a long unsuccessful journy of trial and error, I've decided to ask here...
What kind of project should I create?
What should I do to create this kind of project?
How and where should I #include "TheDllI'mUsing.h" ?
How do I tell the compiler to treat the "TheDllI'mUsing.h" as a pure unmanaged file?
Anything else I might need to know...?
A link to an article would be good too...
Thanks in advance,
Shy.
|
|
|
|
|
You can create a regular DLL project, and enable /clr compilation.
|
|
|
|
|
Hello,
I have written a program in c++.Now I want to make that program a part of a c# program. So to integrate the programs would I have to conver the unmanged c++ code to managed c++/CLI ?
Thanks in advance
|
|
|
|
|
Revant Jain wrote: I have to conver the unmanged c++ code to managed c++/CLI ?
Maybe. Or you could add mixed mode managed wrapper classes.
led mike
|
|
|
|
|
Hello there fellow programmers,
I'm coding a class library which deals with windows hooks.
It uses the SetWindowsHookEx() API function and provides classes for specific hook types.
So far, the code is written in C#, but I only got as far as low-level hooking (i.e. LLKeyboard, LLMouse hooking).
If I try to use global hooks which are not LL, they of course fail, as they are injected to all processes on the system, and not all processes support managed assemblies.
What I intend to do is write a C++ dll, and use it to communicate with my C# dll.
I know there's a way to compile C++.NET code to pure unmanaged C++ code.
How can I do this?
Is compiling managed C++ as unmanaged going to work with the hooks?
Or perhaps I should write my C++ dll directly in C++, and not through C++.NET code...
Thanks in advance,
Shy.
|
|
|
|
|
It sounds like you could use a "mixed mode" project in VC++. If you search MSDN and here on Code Project Articles you will find much information on "mixed mode" development.
led mike
|
|
|
|
|
shyagam wrote: What I intend to do is write a C++ dll, and use it to communicate with my C# dll
IMO this will cause problems, as DLL are loaded in the process
memory space. Maybe you should consider rewriting your hook in unmanaged C++.
If you cannot do this, you could try to encapsulate your C# dll in an executable
(written in C#). Then you inject your dll written in unmanaged C++, which will be in charge
of running your executable with appropriate parameters. If you need return values
then you should consider encapsulating your C# dll in a COM object (which could also
be written in C#). In this case, your C++ dll would invoke this COM object.
Many options available.
shyagam wrote: I know there's a way to compile C++.NET code to pure unmanaged C++ code.
How can I do this?
You should go to
"Project/Properties/Configuration Properties/General/Common Language Runtime support"
and select "No common language runtime support"
You might need to review other settings depending on what you want to do.
shyagam wrote: Is compiling managed C++ as unmanaged going to work with the hooks?
If your project has the "No common language runtime support" set, it will be a regular
dll, so that should do.
|
|
|
|
|
I've created a Win32 project, and specified in the wizard that I'm writing a dll which exports symbols.
I wrote an unmanaged class to deal with the hooks, and I want to encapsulate it in a managed class using the mixed mode.
So I did Project > Add Class, and created a managed class.
Moreover, I've changed the "Common Language Runtime Support" option to /clr...
Is that wrong?
|
|
|
|
|
If you have written your hook code in unmanaged C++, why do you want to encapsulate it
in a managed class? Do you need to reuse the code somewhere else?
|
|
|
|
|
I want my C# apps to be able to use my C++ exported classes.
I can't do that directly from C#, thus I intend to write a proxy managed C++ class.
|
|
|
|