|
Please only post in one forum...
This question don't have anything to do with either Managed C++ or ATL/WTL/STL
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanks, Anders pal!
I will accept your advice.
I cross-posted because my boss is asked me to hand in the
project immediately, but I am in trouble as you
see.
Cheers,
George
|
|
|
|
|
Hi, everyone!
I have searched the help page for "size_t" but failed
to find the help page and information about "size_t".
Where can I find the help page or information about
"size_t"? Can you paste detailed information about
"size_t".
Thanks.
Cheers,
George
|
|
|
|
|
|
Thanks, Nish, my old friend!
I still have a question.
What means "typedef _W64 unsigned int size_t;"?
Does it mean the three objects
_W64, unsigned int and size_t are the same?
Have a nice weekend,
George
|
|
|
|
|
Hello George
It means size_t is a synonym for _W64 unsigned int
And as far as I could make out _W64 has been defined as nothing. Perhaps someone else can correct me here if I am wrong.
So as far as you are concerned you can cast the size_t to an unsigned int
Regards,
Nish
p.s. I found the cross posts humorous, specially your choice of the ATL/WTL forum
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thanks, Nisk pal!
I think I have fully understood the meaning
of size_t under your directions and other pals
in ATL/WTL forum.
Have a nice weekend,
George
|
|
|
|
|
As far as I can see, there's no header file in Managed C++ ?!?!?!?! everything seems to be inlined in the class like this in either a .h or .cpp file that can be included in the main project file:
<code>
__gc public class MyForm : public Form
{
public:
MyForm()
{
Text = S"MyForm";
};
};
</code>
The question, is, can I separate the implementation for the declaration ? to have a header file and a code file ( .h and .cpp ) ?
Are there rules, guidelines or specification ?
Thanks.
Max.
|
|
|
|
|
|
when i use that function (AfxGetInstanceHandle())in managed class i got an exception i do not know how to handle it plz help me.
r00d0034@yahoo.com
|
|
|
|
|
|
first of let me tell u what i am tring to do .
i am trying to convert a vc++ app into dot net.that program is related to mouse and keyboard hooks.
it return HINSTANCE.i know what i do mostly.
i did not initialize MFC from an MC++ app.plzz tell how to do it?
yes it crash at exacetly that point.plzz help.
may i use MFC DLL in managed code if yes then how?
can u provide example related to that?
|
|
|
|
|
I am trying to get my C program to open and close another application.
ShellExecute (NULL,"open","C:/myproject.exe",NULL,NULL,SW_RESTORE);
works to open the application, but I can't get it to close. I've tried
DestroyWindow("C:/myproject.exe");
but it doesn't work. Can anyone tell me what to use for the file reference for DestroyWindow?
Or is there a completely different way to do this better?
squeaky
|
|
|
|
|
Hi squeaky
Read my article below :-
http://www.codeproject.com/system/newbiespawn.asp
That'll show you how to use CreateProcess which gives you both the process handle and the thread handle for the main thread. Now use EnumWindows to enumerate all top level windows. Call GetWindowThreadProcessId on each HWND and compare with the thread ID you had saved earlier. If they match, post a WM_CLOSE message to this HWND.
Hope this helps,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
i want to have process main window window hwnd ?
i tried it by its property
Process.MainWindowHwnd
but i could not successed because when i type cast it into hwnd like this
hwnd=(HWND)INTPTR_OB.ToInt64();
then i want to have its child hwnd by using Getwindow.
but when i use that function in order to get child window it return null although it have child hwnd.
why null?
whats the mistake?
r00d0034@yahoo.com
|
|
|
|
|
how to use SetWindowsHookEx in managed code because when i use it in managed code an exception occure at SetWindowsHookEx?
r00d0034@yahoo.com
|
|
|
|
|
I have a dll where i write
// RMLib1.h
#pragma once
#using <mscorlib.dll>
#using <system.runtime.remoting.dll>
using namespace System;
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Tcp;
namespace RMLib1
{
public __gc class HelloObj:public MarshalByRefObject
{
public:
HelloObj();
String* Greet(String* name);
private:
int numGreet;
};
}
#include "stdafx.h"
this is implementation of these methods
#include "RMLib1.h"
using namespace RMLib1;
HelloObj::HelloObj()
{
Console::WriteLine("HelloObj Activated ");
}
String* HelloObj::Greet(String* name)
{
numGreet++;
String* greeting =S"Hello" ;
return greeting;
}
Inother project i try register this objas remote services
using namespace System;
#using <system.runtime.remoting.dll>
using namespace System::Runtime::Remoting;
using namespace System::Runtime::Remoting::Channels;
using namespace System::Runtime::Remoting::Channels::Tcp;
#using <rmlib1.dll>
using namespace RMLib1;
// This is the entry point for this application
int _tmain(void)
{
Console::WriteLine(S"Hello World");
TcpChannel* chan = new TcpChannel(8085);
ChannelServices::RegisterChannel(chan);
Console::WriteLine(S"Registering Hello Obj As SingleTon ");
RemotingConfiguration::RegisterWellKnownServiceType(Type::GetType("HelloObj"),"HelloObj",WellKnownObjectMode::Singleton);
Console::WriteLine(S"Waiting For Remote Calls");
Console::WriteLine(S"Hit Enter To Exit ");
Console::ReadLine();
return 0;
}
I can compile this code but when try to excecute it gives me
error
System.ArgumentNullException:Value Can not be Be NULL Parameter Name:Type
This line is giving Problem Any Idea.............
RemotingConfiguration::RegisterWellKnownServiceType(Type::GetType("HelloObj"),"HelloObj",WellKnownObjectMode::Singleton);
|
|
|
|
|
Hi
I am new VC++ Can AnyOne Give Me Remoting Example in VC++
using DOTNET
Not in C# or VB>Net
pure VC++
I ll be than ful to u
Harvail
|
|
|
|
|
|
how to use DECLARE_MESSAGE_MAP()in a managed class ?
r00d0034@yahoo.com
|
|
|
|
|
Folks,
I was wondering if there is a way to convert String(managed type) to Cstring(unmanaged type) in MC++?
Appreciate your comments/replies.
CHEERS
John
|
|
|
|
|
#include <vcclr.h>
then, call PtrToStringChars(), passing the managed string:
String* fx_string = S"Hello, World";
CString mfc_string = PtrToStringChars(fx_string);
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
|
I had to check to see why this works because it shouldn't - unless there exists a constructor for CString that takes a String*.
And there is. CString has a constructor that looks like this - note it does exactly what I prescribed (and pins the pointer, which I think I neglected to do):
CStringT( System::String* pString ) :
CThisSimpleString( StringTraits::GetDefaultManager() )
{
const wchar_t __pin* psz = PtrToStringChars( pString );
*this = psz;
}
good catch.
N
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Nick Hodapp (MSFT) wrote:
good catch.
Yeah, I was using this when comparing a String* to a CString in my N-Track program (MFC/MC++ mix). But I just realized that, that is inefficient, because each time a CString object was being allocated on the stack
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|