|
Good reply Luc!
There was a lengthy thread on the MSDN VC board about this recently
that was entertaining.
Cheers!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. This isn't critical but it would be nice to do. I have an app that uses SaveFileDialog^. When the application runs without breakpoints the dialog pops onto the top of the screen as expected, but when I'm debugging the dialog box sometimes ends up invisible until I minimize all other windows. Is there a way to set the dialog box's location and weather it will always be on top.
Thanks,
Buck
|
|
|
|
|
Hi,
you could pass your calling form ("this") to the dialog using this overload:
public DialogResult ShowDialog (IWin32Window owner)
That should keep your dialog on top of the app, so clicking anywhere in one of the app
windows should make the dialog topmost again.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc, I printed this off for my notes, I never would of thought of that.
|
|
|
|
|
Hi.
In the project that I am working, I need to develop a listener that checks a folder and files.
Well, on CLIENT this listener will have detect ANY internal change in ANY file in the folder and instantly will synchronizer with SERVER, like a ShadowCopy, and different of a snapshot, for keep integrity between CLIENT-SERVER, ok?
Can anyone give me a hand? Libraries, and similar components.
I'm working in c++ builder, but visual studio components also help.
Regards,
Caetano Nunes Almeida
|
|
|
|
|
In Visual Studio there is filesystemwatcher component to monitor folder for changes.
|
|
|
|
|
He is looking for a "native" C++ solution (He is in the wrong forum), and he has cross=posted.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Please don't cross post and post in the wrong forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi everyone,
how can i import a dll file in c++ ?
there are millions of pages telling this story for c# on the internet.
but i couldn't find something useful for c++.
would you please write me some code? or point me some link that contains valuable information about the thing i am asking for.
thanks in advance.
MFA
|
|
|
|
|
Do you mean LoadLibrary() or #import ?
|
|
|
|
|
Hi all,
I got a small trouble, If some one know how to do please tell me, many thanks.
I want to assign szData value into textBox->Text, but two kind of variable different type.
I used Visual Studio 2005, and developed VC++ language.
<br />
private: System::Windows::Forms::TextBox^ textBox;<br />
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { char* szData = "abcabcabcabc";<br />
textBox->Text =
}
|
|
|
|
|
Do you need to use "char*" in managed code?
How about this:
private: System::Windows::Forms::TextBox^ textBox;
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
String ^str = "abcabcabcabc";
textBox->Text = str;
} or without the extra assignment...
private: System::Windows::Forms::TextBox^ textBox;
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
textBox->Text = "abcabcabcabc";
}
Mark
Last modified: 20mins after originally posted --
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How about something like this?
textBox->Text = gcnew String(szData);
|
|
|
|
|
<br />
textBox->Text = gcnew String(szData);<br />
Yeah, This way I realy like. Can you introduce more about this. How can you find out this way?
Do you have any tips for this kind?
Sorry, my English very bad.
|
|
|
|
|
Well it's quite simple:
You can create String objects with passing char* to the String constructor.
'Text' is something like pointer. gcnew is something like new in c++ but a little bit smarter. So all we have to do is just create new String^ object with szData as value instead of "" ( String is initialized with "" string normally ).
|
|
|
|
|
Hi,
I am compiling old C++ code in visual studio 2005. I am Getting the error as fatal error LNK1104: cannot open file 'libc.lib' ASMUtils
libc.lib
I found this library is not avialable in VC8. I copied this library from VC7 but still I am getting many other errors.
Even I tried to ignore it by putting Linker-Input-Ignore Specific Libary, but I could not able to fix this bug
Need some urgent help.
Thanks in advance
|
|
|
|
|
This is my code below: It gets the computer name and then the associated IP along with it. If we have the IP address how can we get the computer name? Thanks
void AsyncServer::InitSocks()
{
String* server = "CATUXPSD01";
int port = 4901;
printf("in InitSocks");
String* request = String::Concat(S"Our test data asdf");
Byte bytesSent[] = Encoding::ASCII->GetBytes(request);
Byte bytesReceived[] = new Byte[256];
Socket* s = 0;
IPHostEntry* hostEntry = 0;
// Get host related information.
hostEntry = Dns::Resolve(server);
//hostEntry = new IPHostEntry();
// Loop through the AddressList to obtain the supported AddressFamily. This is to avoid
// an exception that occurs when the host IP Address is not compatible with the address family
// (typical in the IPv6 case).
IEnumerator* myEnum = hostEntry->AddressList->GetEnumerator();
while (myEnum->MoveNext())
{
IPAddress* address = __try_cast<ipaddress*>(myEnum->Current);
IPEndPoint* endPoint = new IPEndPoint(address, port);
Socket* tmpS = new Socket(endPoint->AddressFamily, SocketType::Stream, ProtocolType::Tcp);
try {
tmpS->Connect(endPoint);
}
catch(Exception *e) {
// Handle exception here
}
if (tmpS->Connected)
{
s = tmpS;
break;
}
}
// Create a socket connection with the specified server and port.
if (s == 0) {
printf("Connection failed");
} else {
// Send request to the server.
s->Send(bytesSent, bytesSent->Length, static_cast<socketflags>(0));
}
}
|
|
|
|
|
staticplus wrote: If we have the IP address how can we get the computer name?
They hide that information in the documentation[^]
and again[^]
|
|
|
|
|
Inside <<inside c++="" object="" models="">>, it wrote
"It is stll a bad design choice to declare all functions virutal and to depend on the compiler to optimize away unnecessary virtual invocations."
I can't understand it very well.
|
|
|
|
|
This is the wrong forum, your queston has nothing to do with .NET. Try the Visual c++ forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I probably wont be posting as much now that I have Stephen R.G. Fraser's book "Pro Visual C++/CLI and the .NET 2.0 Platform" which, I can tell, is going to be an invaluable resource. I wanted to use the ErrorProvider component to provide validation error messages, but when I use errorProvider->SetError(control_name, "This is an error"); I get the blinking error icon by the control but the error message is not displayed. Does anyone know why this is? The usage seems to be straight forward enough.
Thanks
Buck
|
|
|
|
|
Hi, try and move the cursor over the blinking ErrorProvider...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Duh. Thanks, it was right there in front of me but I glossed over it.
Buck
|
|
|
|
|
I am looking for some examples or advice of really good data parsers. I am using a windows application and pulling data in via RS-232 ports. The data is typically one byte at a time and is complete data. It will have a header, a command, data, checksum, etc. I am looking for some smart parsers. I have some parsers that work, but I would like to make them more full proof.
Does anyone have any advice of ways to make sure it stays smart or places to find examples of parsers? For example, I had a parser that pulled two bytes of data in at a time. It worked well except for if the system was turned on at an odd byte. If the header was supposed to be in the higher byte, but was now in the lower byte, I had an issue. This problem has been fixed, but I want to see what other people have come across. Thanks for the help.
|
|
|
|
|
epsilonorion wrote:
I am looking for some examples or advice of really good data parsers.
Google Lex Parser
Also many if not most parsing implementations use a finite state machine design.
Also this forum is for C++ managed development. See the first post in the forum. If you are not developing on the .NET platform then your question should go into the Visual C++ / MFC forum
|
|
|
|