|
Depends on how good your code was. It's very possible that portions of your code won't compile, or at least give new warnings.
But, in the first instance, you can open and build it via the conversion wizard, which is automatic, just open the DSW
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hello All,
I have a Combo Box IDC_COMBO, & in the Combo Box Properties (data) , I have added 1,2,3 --- till 10 numbers.
And in the code I have used below code to set the default Combo box value to 0.
case WM_INITDIALOG:<br />
{<br />
HWND hwndCombo = GetDlgItem(hwnd, IDC_COMBO);<br />
SendMessage(hwndCombo,CB_SETITEMDATA,0,0);<br />
}<br />
break;<br />
Now the problem is its not showing the default value 0 on the dialog load and also combo box is empty ..its has no data ……its not showing numbers 1,2, ---10...
Can anyone please help me & tell what is wrong ??? in the above code.
Thanking you,
Suresh HC.
Edit/Delete Message
|
|
|
|
|
In the property window of combobox you insert 1,2,3 or 1;2;3;
|
|
|
|
|
Hello WhiteSky,
Thanks for the responce,
i did that added again 1,2,3,4 but still its not diaplying them , combo box has no data its empty.
can u please tell what is wrong here????
|
|
|
|
|
|
No its not working I tried with both , and also ; . actually I am working on win32 api and not MFC.
|
|
|
|
|
If you use of CB_ADDSTRING for insert data to combobox instead property window what happens?
|
|
|
|
|
Whitesky cant we enter the default data in the combo box which we do in the MFC, where we enter the data in properties..
In api I have to enter each data to the combo box by code ??? using add string ??
|
|
|
|
|
Suresh H wrote: And in the code I have used below code to set the default Combo box value to 0.
case WM_INITDIALOG:
{
HWND hwndCombo = GetDlgItem(hwnd, IDC_COMBO);
SendMessage(hwndCombo,CB_SETITEMDATA,0,0);
}
break;
You are using wrong message for setting value.CB_SETITEMDATA is used to set item data for particular index.
I'm not clear about your wording, I'm assuming that you want first value to be selected and default selection.
You do this by using,
HWND hwndCombo = GetDlgItem(hwnd, IDC_COMBO);
SendMessage(hwndCombo,CB_CB_SETCURSEL,0,0);
|
|
|
|
|
Hello Prasad,
Thanks for the responce.
<br />
HWND hwndCombo = GetDlgItem(hwnd, IDC_COMBO);<br />
SendMessage(hwndCombo,CB_SETCURSEL,0,0);
Actually I have added numbers from 0– 10 in the Combo box properties under data.
After the dialog load combo box is empty no values in that . can u plz tell me what is wrong ???
Yes I want the default value to be selected to 0.
|
|
|
|
|
That properties page where you enter the initial data for the combo box only works in MFC apps.
|
|
|
|
|
|
Hello Friends
Can any body on the forum
Could help me out in knowning how can one Send a file through UDP.
Is there any specific function for the doing the same, or any separate mechanism
is required.
My following requirement is for VC++ 7.1/6.0
Girish
Software Developer
|
|
|
|
|
Why would you send a file using UDP?
UDP is connectionless which means that there's no guarantee that the packet will reach the receiver. Under normal circumstances it would reach the receiver, but you cannot assume that. Thus parts of you file may be lost during the transmission.
On the other hand; using UDP is exactly the same as using TCP.
You open a socket and send to a receiving socket providing the address and port.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
UDP is the wrong protocol to use for file transfers. There is no guarantee that packets will even arrive at the destination.
|
|
|
|
|
I don't agree that UDP is "wrong". It depends on the application.
For example UDP is massively better than TCP if you want to multicast to multiple hosts.
But yes, you do have to handle transmission problems yourself - you don't get return codes from the APIs that you do with TCP.
It is also difficult to make UDP secure - then again TCP isn't secure on its own (needs a security layer such as SSL).
cheers,
Neil
|
|
|
|
|
Hello Neil,
Thanx for your timely suggestion
Can i know exactly further how should i go ahead.
I want to send a file through UDP.
I am aware of it using in TCP.
Can i know how it is done in UDP
Thanx in Advance
Girish
Software Developer
|
|
|
|
|
As already mentioned, it isn't a good idea to do file transfer over UDP given it is connectionless. Doing it over TCP (with or without a security layer) will be easier and more reliable.
I believe that the TFTP system is designed to transfer files over UDP. Although TFTP isn't really used these days, I think from memory that the process of remote booting a workstation uses it, and transfers the boot image from the server to the client over UDP.
Therefore, if you absolutely must transfer a file over UDP and have no other options, see if you can find an open source TFTP program to give you some pointers on how to do it. Most likely you will find the code to be *nix oriented though. You may even be lucky enough to find a TFTP library you can use as well.
------------------------
Luke Lovegrove
------------------------
|
|
|
|
|
How to DoModal a winodw on all of the othere programs; winodws
|
|
|
|
|
|
Use extended style WS_EX_TOPMOST while creating dialog.
|
|
|
|
|
Hi,
assume i want to create a dynamic array of bytes(or any other data type) (unsigned char *p = new unsigned char[100]; ), how can i ensure that it is aligned to a 32-bit boundary?
|
|
|
|
|
#pragma pack(push, 4)
unsigned char* p = new unsigned char[100];
#pragma pop()
will do it, I think. (I'm not sure how is new affected by pragma pack).
Nuclear launch detected
|
|
|
|
|
|
I am afraid that #pragma pack will have no impact on the above code, its primarily used to align members of a structure, such as this:
#pragma pack(push, 1)<br />
struct myStruct<br />
{<br />
char szTmp[20];<br />
short iIndex;<br />
...<br />
}<br />
#pragma pop()<br />
|
|
|
|