|
|
Thanks!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
Because that's just how the copy constructor works. The parameter has to be a reference. If it weren't a reference, how could you make a copy of the input object? (You don't have a copy constructor yet, you're writing it!)
|
|
|
|
|
I am creating a console app that starts NOTEPAD.EXE but then needs to emulate the user accessing the menu.
I have started the process by using
Process::Start("NOTEPAD.EXE");
Now I need to simulate a user pressing 'Alt F' to access the file menu - how do I achieve this ??
Pete
|
|
|
|
|
Off the top of my head....
Use the non static version of Process::Start() so you have a Process object
Call Process.MainWindowHandle() to get a handle to the window
Then use Win32 functions or MFC to send messages to the window using the handle
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
Thanks Josh,
See how we go.....
Pete
|
|
|
|
|
I woud like to have an example, how to encryipt String into md5 hash.
Coud md5 encryption produce same hash as md5 from php?
Thanks in advance
|
|
|
|
|
Look up MD5CryptoServiceProvider on MSDN.
Here's some sample code from MSDN :-
private:
array<Byte>^ MD5hash( array<Byte>^data )
{
MD5^ md5 = gcnew MD5CryptoServiceProvider;
array<Byte>^ result = md5->ComputeHash( data );
return result;
}
|
|
|
|
|
I already saw it, but i wan't to hash my String (password). I can't use Byte as an imput.
this is php example:
<?php
$string = "secret";
echo md5($string);
?>
the output would be: 5ebe2294ecd0e0f08eab7690d2a6ee69
how can i achive this in c++/cli?
|
|
|
|
|
Found an article abaout it here on CP:
http://www.codeproject.com/dotnet/MD5FunctionPHP.asp
Now it works, perfectly
|
|
|
|
|
Hi All,
My following code shows how I am starting a process, in this case it's NotePad.
Process^ myProcess;
myProcess = Process::Start("Notepad.exe");
How do I then control the Window State - for example, if I want to Minimize the window, how is this achieved ?
Pete
|
|
|
|
|
Use this overload :-
Process^ Start (ProcessStartInfo^ startInfo)
Set the WindowStyle property of the ProcessStartInfo object to ProcessWindowStyle::Minimized
|
|
|
|
|
G'Day Nish,
Thanks for that - all sorted out now.
Pete
|
|
|
|
|
Hello
I am using Combobox, and I have to manage quite big amount of data, If I do it with if sentence to assing the values, the program takes an excessive time.
The time it is taken when the event OnselChange is used (because of the amout of if used). This can be avoided in MFC by using Set/GetItemData, Is there any alternative to this with the CLI??
Thanks in advance
|
|
|
|
|
I am not a MFC programmer but the .NET Framework uses data binding to populate such controls.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
The items collection in the combobox is a collection of type object
As far as I know you can put any object in there and it will call ToString() on the object to get the label for the item.
System.IO.Path.IsPathRooted() does not behave as I would expect
|
|
|
|
|
|
Ok I did it,
I create the class
ref class MyDatas: public System::Object<br />
{<br />
String^ Name;<br />
double Value1, Value2;<br />
<br />
public:<br />
MyDatas(String^ NameC,double Value1C,double Value2C)<br />
{<br />
Name = NameC;<br />
Value1 = Value1C;<br />
Value2 = Value2C;<br />
}<br />
public:<br />
virtual String^ ToString () override<br />
{<br />
return Name;<br />
}<br />
<br />
};<br />
and I add the items to the comboBox like,
<br />
this->cBMyDatas->Items->AddRange(gcnew cli::array< System::Object^ >(4)<br />
{<br />
gcnew MyDatas("Data1",1,1),<br />
gcnew MyDatas("Data2",2,2),<br />
gcnew MyDatas("Data3",3,3)<br />
});<br />
And to get the item selected I just have to make a cast
DataSel = (MyDatas^) cBMyDatas->SelectedItem::get();
Thanks
|
|
|
|
|
Hi,
I've got a bunch of dll libraries written in VB that I would like to use within C++ (I'm using C++ within VS .NET).
I've gone through the archives, but can't find anything that provides examples of how to incorporate and use the dll functions.
Does anyone have any pointers or examples?
Thanks in advance,
John.
|
|
|
|
|
You won't find examples because they are not needed. All DLLs created by VB (at least up to version 6) are COM/ActiveX objects.
|
|
|
|
|
Hi all,
First of all, I hope this is the right place to post this thread...
I have recently received code which I must re-compile, the only thing is that the code was compiled in VS 2003 .Net, and I'm trying to re-compile it in VS 2005. I'm receiving alot of errors, and I have no Idea how to fix them, could any one please help??!!??
Thanx in advance.
ERRORS:
Error 1 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) Stdafx.obj
Error 2 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) AssemblyInfo.obj
Error 3 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) AssemblyInfo.obj
Error 4 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) Gdi.obj
Error 5 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) Gdi.obj
Error 6 fatal error LNK1120: 1 unresolved externals c:\ID Print Source\IDCardPrint 2005-11-22\Native\bin\Release\Native.dll 1
Error 7 fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxver_.h 77
Error 9 'Could not load file or assembly 'Syncfusion.Core' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))' C:\ID Print Source\IDCardPrint 2005-11-22\IDDesign\LC IDDesign
Error 11 'Could not load file or assembly 'Syncfusion.Core' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))' C:\ID Print Source\IDCardPrint 2005-11-22\IDDesignApp\LC IDDesignApp
The only programmers that are better than C programmers are those who code in 1's and 0's.....
 Programm3r
|
|
|
|
|
Hello,
I wrote a native C++ dll which contains a class to hook windows messages.
As the callback function, I send a function pointer to my callback which is inside of my dll, but outside of the class.
I want a new instance of the function to be created for each instance of the class.
However, I can't declare my callback as non-static.
If I move my callback inside the class, and remove the static keyword I get a compile error saying:
"error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'HOOKPROC'".
What can I do?
Any workarounds?
Thanks in advance,
Shy.
|
|
|
|
|
A callback that the operating sytem calls must be static.
There is only one instance of a function, whether the function is static or not. The only difference between a static and non-static member function is the this pointer.
|
|
|
|
|
With that said, how can I workaround this issue?
I need my callback to use instance variables, but of course it's not possible as they have to be static also.
If I use static variables it won't be any good to me...
Help...??
|
|
|
|