|
I try And i have this error :
StringToHGlobalAnsi is not a member of Global Namespace
I thing it need one include file. What is this header file ?
|
|
|
|
|
System.Runtime.InteropServices
RaJ
|
|
|
|
|
Use this.
double da = Double::Parse(String ^);
Manish Rastogi
|
|
|
|
|
I am using Visual C++ NET 2005.
I want to convert string to numeric using atof fonction. I have an error atof an identifier not found. I had #include "math.h" and "stdlib.h"
whan I do that: par->Value = atof(this->taux->Text::get()); I have an error cannot convert parameter 1 from string^ to const char*
What to do ?
-- modified at 8:42 Friday 29th June, 2007
|
|
|
|
|
This is not a C++/CLI question, try 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 )
|
|
|
|
|
Use this.
double da = Double::Parse(String ^);
Manish Rastogi
|
|
|
|
|
My Windows app has a help file in PDF format.
How do I display this file when user clicks on Help command?
Thanks.
|
|
|
|
|
You asked in the C# forum, why ask here ?
Process.Start will show it, if the reader is installed.
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 )
|
|
|
|
|
You can use WebBrowser control in your form and call webBrowser1->Navigate(<file name="">) to open the file in the browser.
|
|
|
|
|
I'm somewhat new to managed c++, so I would like a little clarification.
We have a large codebase of unmanaged c++ that runs as a plugin in another application (VS2002 rocks/NOT). The plugin world has it own coding rules and libraries that we have to use.
We are in the process of writing about 300K lines of code and are looking at c# just for the productivity enhancements. Also, they do not all have to run in the plugin.
My question is, is it possible with managed C++ to create a COM object that will link some these C# DLL's with are existing plugin code? This would be a huge help if it is not hard.
Thanks in advance.
Tom
|
|
|
|
|
You don't need C++/CLI to write a COM object, but if you use C++/CLI, you don't need to use COM, you can use .NET to get finer grained access to the C# objects you've written.
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 )
|
|
|
|
|
Just to clarify, I can use c++/CLI to link my existing base of unmanaged code developed with VS2002?
|
|
|
|
|
You'd want to modify your existing app to also use C++/CLI, then, yes. That doesn't mean changing all your code, you just add C++/CLI support.
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 )
|
|
|
|
|
How can I retrieve data from datagridview on a row that I click on ?
|
|
|
|
|
You can try
Void dataGridView1_CellContentClick(System::Object^ sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {
String^ strVal = dataGridView1->Rows[e->RowIndex]->Cells[0]->Value->ToString();
}
|
|
|
|
|
Thanks Sir; It's Work Very well. But The event Cell_click is good for what I need.
|
|
|
|
|
Hi
I injected a DLL into another process. So far, it works fine.
Now I'd like to send messages to the DLL ... I'tried PostMessage but it always returns ERROR_INVALID_THREAD_ID
The code looks like this:
<br />
CreateRemoteThread(hProc, NULL, NULL, (LPTHREAD_START_ROUTINE)LoadLibAddy, (LPVOID)RemoteString, NULL, &ThreadId); <br />
<br />
while(!PostThreadMessage(ThreadId, WM_MYMSG, NULL, NULL))<br />
{<br />
if(GetLastError() == ERROR_INVALID_THREAD_ID)<br />
break;<br />
else Sleep(500);<br />
}<br />
and the DLL loops until a message is received (so it loops infinitivly atm )
<br />
while(1)<br />
{<br />
if(GetMessage(&msg, NULL, 0, 0))<br />
break;<br />
}<br />
thanks in advance !
|
|
|
|
|
You could get the injected DLL to take over the main window's message procedure and handle that yourself..? You could then just send messages from your other application to the application with the DLL injected into it, which the DLL would handle..
Hope this helps!
--PerspX
|
|
|
|
|
How could I write a simple utility that when Control + Shift clicking a folder would bring up a small text box next to the folder. In there I can type a search query, hit enter and it would then search the folder's contents?
Results would pop up in a new explorer window as if I did a Windows search.
Windows search sucks I need something quick and easy!
|
|
|
|
|
btw, not sure if this is the right place for this post.. if it isn't please let me know
|
|
|
|
|
Hoi there,
i need some help with an ActiveX Control under VC++ .Net
The Method is defined as:
UploadBuffer(VARIANT* VarPBuffer).
After using the Wizzard i got a Windows Form and a Wrapper Class for the control with the following signature:
public short UploadBuffer(ref object VarPBuffer)
and ILDasm shows UploadBuffer:int16(Object&)
Now here's the problem
I got an array of unsigned chars which need to be transfered to the activex controll buffer. In VC++ with MFC this was done this way:
COleVariant *m_Buffer;
CByteArray *m_Array;
...
...
m_Array = new CByteArray;
m_Array->SetSize (1024 * 768);
m_Buffer=new COleVariant (*m_Array);
How do i get this thingie working under .Net ;/ It's realy driving me crazy (And no i can't just recompile the ocx because its comercially sold and the source code is not available)
I hope someone is able to help me
Thx.
|
|
|
|
|
Hello,
The following code snippet invokes a function by its name.
It works fine but the function's name and its arguments must be used separately.
What I would like to do is to type in my function from an edit control as it is defined
E.g. MyFunc(arg1, arg2).
But before invoking it, I assume that I must parse it to get its name and arguments separately.
So I am wondering if Dot.Net framework provides either a parsing method that will easily split the function name and the arguments or better an invoke method where I can just pass my function in one shot with all its arguments?
Could you please help me to find a straightforward solution?
<br />
Object* CInvoker::InvokeMethod(String* method, Object* args[])<br />
{<br />
<br />
Module* module[] = Assembly::GetExecutingAssembly()->GetModules(false);<br />
<br />
CExternal* objexternal = new CExternal();
Type* typExternal = module[0]->GetType("CExternal");<br />
MethodInfo* methodinf = typExternal->GetMethod(method);<br />
Object* ret = methodinf->Invoke(objexternal, args);<br />
return ret;<br />
<br />
}<br />
|
|
|
|
|
Hello all,
Can someone point out the difference between these
two HelloWorld programs ? I don't get why one uses the
'using' statement and i don't get the '.h'
(i'm trying to move from C# if that helps)
*************** -- 1
<br />
#include <iostream.h><br />
#include <stdlib.h><br />
<br />
int main() {<br />
<br />
cout << "Hello, World!" << endl;<br />
system("pause");<br />
<br />
return 0;<br />
<br />
}<br />
*************** -- 2
<br />
#include "stdafx.h"<br />
#include <iostream><br />
using namespace std;<br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
cout << "Hello World!" << endl;<br />
system("pause");<br />
<br />
return 0;<br />
}<br />
Thanks
|
|
|
|
|
This is a C++/CLI forum, your question is off topic here.
As you didn't check "Ignore HTML tags in this message (good for code snippets)" I cannot read all your code, but I suspect that one includes iostream.h and the other includes iostream. iostream.h is not standard C++, the latest Microsoft compiler will reject attempts to use it.
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 )
|
|
|
|
|
In addition to Christian's reply...
Please post non-managed-c++ questions on the appropriate board.
The "using namespace std;" line...I'll quote from the docs:
"The using directive allows the names in a namespace to be used without the namespace-name as an
explicit qualifier. Of course, the complete, qualified name can still be used to improve
readability."
cout and endl are in the std namespace. Without the using directive you'd have to specify the
namespace:
std::cout << "Hello World!" << std::endl;
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|