|
Sure, try Googling: Fiddle with Project Properties
Seriously though, you can't avoid installing the C Runtime library but most of the others (MFC, ATL, etc.) can be statically linked by "fiddling".
|
|
|
|
|
You can link statically to the dlls, which makes your app bigger, as it will copy them into your exe.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi everyone,
i have a problem, i want to convert string to character array. heres is the scenario:
char *echostring;
char ip[RCVBUFSIZE]; //32
ip =txtIpAdd->Text; //textbox
echostring = ip //<--- cause an error,it says, cannot
convert string to char[32]
thanks in advance,
jeof
******************************
to know
everything
is to know
yourself...
|
|
|
|
|
This normally works for me
char* echostring = (char*)Marshal::StringToHGlobalAnsi(ip).ToPointer();
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
you would have to point to ip[0] or &ip
echostring = ip[0];// << this will make it be the address of the first position[0] of the string same as &ip.
by the way this is for C++.
|
|
|
|
|
echostring = ip;
is fine.
The error is here:
ip = txtIpAdd->Text; //textbox
You can't do that
As programm3r mentioned, something like this should work:
char *echostring;
char ip[RCVBUFSIZE]; //32
const char *chars = (const char *)(void *)Marshal::StringToHGlobalAnsi(txtIpAdd->Text);
strncpy(ip, chars, RCVBUFSIZE);
Marshal::FreeHGlobal(System::IntPtr((void*)chars));
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello,
I converted VS2003 code to VS2005 (C++, C#).
I try to use DLLs which use: System::Runtime::InteropServices.
Do you know if it is OK? I got runtime error...
Thanks!
|
|
|
|
|
Tal S. wrote: Do you know if it is OK? I got runtime error...
You're not giving us much to work with
I'm going to guess it's not ok, since you get a runtime error.
Does debugging yield any clues?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello, I work with visual studio 2005, VC++ Managed, I want to carry out a reading of a document .TXT, and to post it in a list view or other, I want by exemle to post that the 10 line 1st. Thank you enormously.
|
|
|
|
|
Have a look at StreamReader class
|
|
|
|
|
Where is the StreamReader class,
Thank you verry mutch.
|
|
|
|
|
In the System.IO namespace
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Firstly, this is incorrect forum. You should have posted this here: http://www.codeproject.com/script/comments/forums.asp?forumid=1647
Secondly, here is answer to your question:
GetProcAddress()[^]
|
|
|
|
|
hi friend i want souece code of polynomial program (add,multipy,..two polynomial) and also need the source code of aoe network in graphs and source code of winner tree program please help me as soon as possible.
Sincerely yours
|
|
|
|
|
My contract rate is > $100 an hour. Alternatively, you can do your own homework, and then I'll help for free, when you ask specific questions that show you've done somethig yourself.
I suspect you meant to post this in the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I am using sendASPI32Command for writing data to CD. But for a particular size of data sendASPI32Command returns SS_ASPI_IS_BUSY error. The error occurs when writes the last track data.
Could u pls tell in which condition this case occurs.Please help..........
Ajay
AJay
|
|
|
|
|
Have you tried MSDN ? This doesn't look like a C++/CLI question to me, have you tried the visual C++ forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a window handle (HWND) obtained from a DLL (the lib creates its own dialog form and returns handle to it - /library is written using MFC - code is as follows/).
What I need to do is to 'dock' this window somehow in a TabControl of an application written in Managed C++, VS 2005 (preferrably as a new Tab).
So basically I need sth like conversion from HWND to a usable object in .NET (Control^ or TabPage^ perhaps?). What I tried to do, is use of System::Windows::Forms::Control::FromHandle() function with my Handle casted to IntPtr, but it didn't work (my guesses: it only handles controls already created using .NET, not 'simple' WinAPI windows). It's also possible, that I've missed something obvious - I'm a complete newbie to all this .NET stuff.
My 'main' application used to also be written using MFC, so I could convert this handle back to CWnd* (using FromHandle() )and act on it as on a 'normal' MFC window (in eg.: call ShowWindow(SW_SHOW) or SetParent() for it).
How to do such a thing in .NET (meaning: to get a window from HWND, place it as a child of a Windows::Forms container (like TabControl or sth else), move/resize it to client's dimensions, and then show it to the user)?
A sketch of code that creates the window:
HWND LoadDialog() {<br />
CMyDialog* pNewDialog = new CMyDialog(); <br />
<br />
pNewDialog->Create (MAKEINTRESOURCE(IDD_RESOURCE), NULL))<br />
<br />
return pNewDialog->GetSafeHwnd();<br />
}
PS. I've posted a copy of this post to codeguru
|
|
|
|
|
matmus wrote: PS. I've posted a copy of this post to codeguru
If you get a solution, please post it here I'm curious about this one.
I do know Control::FromHandle() returns the Control already associated with an HWND, not a
Control created from an HWND.
I have always wondered if you could create a control from an HWND though. At first thought,
there's alot of reasons it wouldn't work well, especially with an MFC HWND...
Thanks,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: At first thought,
there's alot of reasons it wouldn't work well, especially with an MFC HWND...
To be honest... now I'm having these thoughts (I still hope that it's possible though, my faith is just a bit weaker - WinApi is not assembly language after all, and what I need is not a 'full object' (meaning ::Form) - I was thinking of it rather as some kind of a wrapper, to call functions on (thought it'll be easier to use embedded .NET/Managed C++ functions than go down to API level).
BTW: why do you think, that MFC HWND is somehow special? In my opinion windows after creation are indistinguishable. Till now I was convinced that (in MFC) i can call FromHandle() on every window (even windows, which I don't own) - now I'm not so sure of that.
Since I've got no answer so far, I've slightly changed my approach.
Basically the question still is:
How to place this window (having only its HWND) as a new tab page in TabControl created via Managed C++ /I get the window by HWND and have to handle/display it somehow in my application. Creation/destruction ow this window is performed by the plugin itself/
But... I no longer care if I need to convert HWND to System::Control or do the exact opposite: convert TabPage to HWND and use API functions to bind them). I just need to get it done.. somehow (if it involves mixing managed and unmanaged code - so be it however I still hope that this is avoidable ). I've considered even converting .NET object to MFC, still I don't even know if it's possible, not to mention the 'howto' part.
Could someone point me at a usable piece of code?
Thanks in advance,
|
|
|
|
|
matmus wrote: BTW: why do you think, that MFC HWND is somehow special? In my opinion windows after creation are indistinguishable.
True, HWNDs are HWNDs. The problem that comes to mind is that .NET isn't a framework specific to
Windows. MFC is. The little things MFC does with message handling may not be compatible with
what the Windows .NET implementation does. So to have an MFC window mixed in with .NET forms in
the parent/child heirarchy may or may not work.
Of course, we know that the Windows implementation of .NET is using HWNDs behind the scenes for
its "forms" but the .NET framework wasn't meant to be Windows specific.
For those of us using .NET specifically for Windows, I think it could/would be handy to be able
to create .NET Control objects from an HWND. There's the Microsoft.Win32 namespace for Windows-
specific stuff, so that would be a good place to put it IMO.
We'll see what happens with the next versions of MFC. I know there's going to be some additions
for mixed-mode programming and I'm anxious to see what they add, since that's what I do
Until then, all my UI stays MFC and I'll use the .NET framework for anything else I can leverage
from it that's non-UI related.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have some extern/global variables and want to localize them to different class which are using them.
In other words I want to move them to different classes, utilizing their functionalities.
Note: These variables are shared by all the classes.
Please suggest me a way of doing it.
Thanks in Advance
S.S
|
|
|
|
|
i make a multi-dimesion array in a class and in its private.
and i want an array of pointer to return this addresses and i want to make it multidimension.
how can i do that.
thanks
******************
******************
** Ahmed Ismail **
******************
******************
|
|
|
|
|
My managed c++ assembly has a strong name and was signed with proper certificate.
When it's hosted by IE with StrongNamemembershipCondition, it works fine.
If I use PublisherMembershipCondition instead of StrongNamemembershipCondition, it doesn't work and get the below security exception.
Unverifiable assembly '...' failed policy check
How can managed C++ be hosted by IE with PubhliserMemberShipCondition?
|
|
|
|