|
neha_rai wrote: i have written this code that splits the number of cars T. to the number of paths R in all possible ways.
Sounds like you need to read up on combinations and permutations.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all,
I have two applications in VC6.
I have to copy only a single dialog box (not the entire RC file) from one application
to other.
I know we can copy the RC file , but I dont want the entire RC file.
I want to copy only one dialog box from the one RC file and paste in other RC file.
Please suggest.
Regards,
Sunil Kumar
|
|
|
|
|
Hi,
Open the rc file on a notepad or if u r using VS2005 or greater right click on the rc file -> View Code
copy the Dialog declaration's and paste it into your rc file.
thanks
Nitheesh
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
So I've taken it apon myself to finally get a better grasp on C++. I've had experience in C#, VB.Net and Java and decided, on my own time, to finish the jump into C++.
I've read a book entitled C++, How to program by Deitel, and it is by far way better then the C++ Primer Plus I went through and entirely better then the mistake that was "C++ in 21 days" which was a complete waste of time.
I think I have a handle on the basic concepts, syntax and whatever else the book went through and I think I'm ready to tackle a book that deals with C++ and the MFC. Anyone out there who's been at where I am, still a beginner ready to tackle new concepts (as I've been explained, MFC is where I should go) can please recommend a good reference / beginners book on C++/MFC? Any links on the internet? Anything at all to make a good jump?
A book / article that deals with C++/MFC and using Visual Studio as a compiler is a plus, and any help at all would be greatly recommended. Thanks for the read in advance,
Elie.
|
|
|
|
|
Hi Elie,
I'm pleased to see a .NET programmer wanting to learn Visual C++. My MFC book recommendations are here[^]. I'm sure that others here will be able to provide you with more inputs on that.
Additionally, Thinking in C++ is an excellent, two part book by Bruce Eckel and is freely (and legally) available for download on his site. You can download it : here[^] (the link is actually a mirror, because Bruce's site seem to take too long to load). I did notice you saying that you've done the basics, but this book(s) is one of my favourite C++ books and is worth a read, if you haven't read it yet.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I've been reading o lot on the topic of comparisons in the web lately and I can't find anything interesting. The question is how to compare string output to a map where keys are alike defined strings which represent vectors of integers. I guess I'll have to write a template or a class to do it and it isn't an easy task for the beginner. I would be very grateful for any kind of help!
Waldemar
|
|
|
|
|
Not sure if I understand your question correctly.
But there is a map class in the C++ Standard Template Library.
You are probably looking for something like -
typedef std::map<std::string, std::vector<int>> StringIntVectorMap;
So you can create objects of this type -
StringIntVectorMap compare;
Read more about the map class here - map Class[^]
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks Superman
I'll have a look at it!
|
|
|
|
|
Unfortunately, your hint won't work. I've just realized I've reached a stage that could be called 'advanced programming'. If you're interested in this particular case, I can quote the entire code. Just let me know, providing you've got time to look at it. Anyway, thanks a lot!
|
|
|
|
|
COM port CreateFile -> Close Handle Works great, unless the USB device is unplugged, then it can not be reopened without restarted computer
If usb device is ever unplugged, i get a return of a ERROR_FILE_NOT_FOUND from Create handle, and cannot continue unless the computer is restarted
this happens when I am connected to the device and when I am not connected, just if it is unplugged and replugged in
(this works awesome, and can continue to create and close, until the device is unplugged from the computer and plugged back in)
hcomms[hcommcount-1] = CreateFile(com,
GENERIC_READ | GENERIC_WRITE,
0,
0,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL ,
0);
if ( hcomms[hcommcount-1] == INVALID_HANDLE_VALUE)
{
DWORD error = GetLastError();
return -1;
}
if (!CloseHandle(hcomms[cindx]))
{
errorCode = GetLastError();
}
|
|
|
|
|
Greg Mort wrote: COM port CreateFile -> Close Handle Works great, unless the USB device is unplugged
What kind of USB device? Is this a USB to Serial adaptor? Can we get a little more information?
|
|
|
|
|
its a custom made device, it uses the mchpcdc drivers
|
|
|
|
|
Well Greg,
I would be willing to bet that each time you plug-in the USB device Microsoft Windows is assigning a new COM port.
Best Wishes,
-David Delaune
|
|
|
|
|
hi,
can anyone suggest me how to convert wchar* to byte*...
Thanks,
Rakesh
|
|
|
|
|
You can simply cast the pointer to PBYTE or BYTE*
wchar_t buf[] = L"Hello World";
PBYTE pBytes = (PBYTE)buf;
Best Wishes,
-David Delaune
|
|
|
|
|
hey,
its not converting fully...
if i have wchar* q = "AJC";
when i convert it using ur method,
PBYTE pbytes = (PBYTE)q;
its giving pbytes as C alone...
can u shed some light on it?
Thanks,
Rakesh
|
|
|
|
|
|
wchar_t* q = L"AJC";
This creates a pointer to a wide character string.
To convert this to BYTE* which is a multi-byte character string you can use the WideCharToMultiByte[^] API.
But then a BYTE pointer will not suffice.
You will need a BYTE array declaration. Something like -
BYTE bytes[255];
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Well, I developed a very basic client/server application by extracting knowledge from the article.
http://69.10.233.10/KB/IP/serversocket.aspx[^]
The application works fine when client/server exchanges text data (Hello, Hi etc of few bytes). But when server sends the image data (say a bmp of 3 MB). The send function sends data properly but on receiving side, the received bits are just 256. where the rest bits gone?
How can we transfer image data (upto MB) through the client/server application? any idea
|
|
|
|
|
Madhu_Rani wrote: How can we transfer image data (upto MB) through the client/server application? any id
The article you referenced supports both TCP and UDP so which protocol did you choose?
Best Wishes,
-David Delaune
|
|
|
|
|
TCP... but do you think it is protocol dependant?
|
|
|
|
|
Madhu_Rani wrote: TCP... but do you think it is protocol dependant?
The reason I asked is because UDP does not guarantee data packet delivery. The first thing that came into my mind when you described packet loss was the UDP protocol. It looks like the author of the project is very active in his article message board so you may want to address him there.
Best Wishes,
-David Delaune
|
|
|
|
|
i want to make windows 32 console application and use task functionality to send task to outlook contact using plain C++
can any bod help me ?
I am using VS 2008 Professional Edition
|
|
|
|
|
Fuad Abu Sameer wrote: i want to make windows 32 console application and use task functionality to send task to outlook contact using plain C++
can any bod help me ?
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Currenlty my application is working fine for MS Word 2000 to 2007.Now I need to make it compatible for word 97.
Iam using MFC Word Automation to open the document and doing operations inside the ActiveX Controle.
Iam using early binding.i.e using wrapper class
Please help is needed.
|
|
|
|