BSTR->string LPCTSTR->const string LPSTR -> string unsigned int->UInt32 DWORD -> long
fang_eric
Posts
-
Changing datatype from VB.NET to VC++ 6.0 -
How can I use the loop indexing for a textbox's name?do it in other ways. TextBox tb[] = {textbox1,textbox2,...,textbox5}; for(i=0;i<5;i++) { tb[i].Text = foundRows[i].ToString(); }
-
Accessing a control from a separate classtry it as "public static",it will work well. but it's not the best sovlution.
-
Method executing at specific (clock) timei think that use the Timer will match your needs.
-
Check if open is already openif that is like you said, that needs to use Mutex.
-
Check if open is already opendo it with the form load event that like this: if (Process.GetProcessesByName(yourprocessname).Length >=1){ MessageBox.show("already opened!"); return; }
-
2days........how to decoderthere are two ways to slove this problem. first is that after you read the bytes,then you convert it to unicode : string temp_string = sr.ReadLine(); // Create two different encodings. Encoding ascii = Encoding.ASCII; Encoding unicode = Encoding.Unicode; // Convert the string into a byte[]. byte[] assciiBytes = unicode.GetBytes(temp_string ); // Perform the conversion from one encoding to the other. byte[] unicodeBytes = Encoding.Convert(unicode, ascii, assciiBytes ); the second is that initalize the StreamReader with unicode: using(System.IO.StreamReader sr = new System.IO.StreamReader(temp_path, Encoding.Unicode)) { } Just do it!
-
MousePosition vs lParamSince LParam is 64 bit number, so you have to convert it to int64 type.
-
A tool that just like "Windows Picture and Fax Viewer overview".I want to make a tool that just like "Windows Picture and Fax Viewer overview". 1. Increase or decrease the image preview size. 2. View the image in full size or as the best fit for your window. 3. Manage image files and print, save, delete, or change file details. 4. Open the image in an editing program if you wish. Note that this closes Windows Picture and Fax Viewer. 5. Rotate images right or left by 90 degrees. Thanks a lot for help in advance!
-
how to get the hostname of a client pc in my networkI think the GetHostbyAddress() method can help you. the followed code is copyed from msdn: try { IPAddress hostIPAddress = IPAddress.Parse(IpAddressString); IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress); // Get the IP address list that resolves to the host names contained in // the Alias property. IPAddress[] address = hostInfo.AddressList; // Get the alias names of the addresses in the IP address list. String[] alias = hostInfo.Aliases; Console.WriteLine("Host name : " + hostInfo.HostName); Console.WriteLine("\nAliases :"); for(int index=0; index < alias.Length; index++) { Console.WriteLine(alias[index]); } Console.WriteLine("\nIP address list : "); for(int index=0; index < address.Length; index++) { Console.WriteLine(address[index]); } } catch(SocketException e) { Console.WriteLine("SocketException caught!!!"); Console.WriteLine("Source : " + e.Source); Console.WriteLine("Message : " + e.Message); } catch(FormatException e) { Console.WriteLine("FormatException caught!!!"); Console.WriteLine("Source : " + e.Source); Console.WriteLine("Message : " + e.Message); } catch(ArgumentNullException e) { Console.WriteLine("ArgumentNullException caught!!!"); Console.WriteLine("Source : " + e.Source); Console.WriteLine("Message : " + e.Message); } catch(Exception e) { Console.WriteLine("Exception caught!!!"); Console.WriteLine("Source : " + e.Source); Console.WriteLine("Message : " + e.Message); } Just do it!