|
Might want to ar << listbox.GetCount(); first.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Of course. I never indicated it was a complete working code example, hence the "Something like" qualifier. When typing this stuff from memory, small details often get omitted.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Hi All.
The problem I am facing is a bit different. Even I do not know, whether the problem is related to Embedded programming or can be solved with VC++ MFC itself.
I want to send and recieve data between my vc++ application and a USB device. Thats the main issue.
Can anyone tell from where to start or if anyone can help me with the coding that should be done...I will be very thankfull for that help.
Thanks and regards,
Pankaj Bhalla
pankajbhalla@mantraonline.com
Pankaj Bhalla
Consultant - VC++
|
|
|
|
|
Which USB Device you are talking about.
Please Clarify.
|
|
|
|
|
Hello Darshan.
Thanks for your consideration and time. Actually, the USB device is itself, under the process of creation. So, not sure about the device, but if you can then please tell me general steps we have to take to make it possible. I mean the articles or any other source from where I can get more information about this issue. If you can the please tell me the MFC classes we can use or any info. about MFC and USB devices.
Thanks and Regards,
Pankaj Bhalla
|
|
|
|
|
Where can I download GDI+ librarys and headers?
|
|
|
|
|
You can get it from:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
I think it's in the core SDK part.
|
|
|
|
|
I've got a char array
<br />
char *vec;<br />
and i allocate memory for a number of elemets
<br />
vec = (char*) malloc ((sizeof(char))*(number_of_elemets));<br />
i do that in main.
then i call a free function
<br />
free_mem (vec);<br />
the function code is:
<br />
void free_mem (char *vec,number_of _elements)<br />
{ <br />
for (i=0;i<(number_of _elements);i++)<br />
{<br />
free (vec[i]);<br />
}<br />
}<br />
it gives me errors
what's wrong?
thanks!!
|
|
|
|
|
try this:
char *vec;
vec = new char[number_of_elements];
|
|
|
|
|
it's only ansi c, i can't use c++
|
|
|
|
|
I think you can just use free(vec), not free(vec[i]). Or maybe the error occurs because you forgot to pass the number_of_elements argument when you call free_mem?
|
|
|
|
|
Indrawati wrote:
I think you can just use free(vec) ...
Correct.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hello,
I compiled a program that reads the MAC-Adapter information and
therefore requires IPHLPAPI.DLL.
Now, on XPPro it's fine. DependencyWalker shows EFSADU.DLL to be
present in C:\windows\sytem32.
On XPHome, DependencyWalker shows this file as missing.
However, the program also runs on XP Home without any problems.
Now my question: Should I not care about the DependencyWalker warning
on XPHome? But then, why does this warning come up?
Could it be that DependencyWalker lists DLLs as missing although in reality they are never called (and therefore my app also works on XPHome)?
This is the dependency of the mentioned EFSADU.DLL:
IPHLPAP.DLL->MPRAPI.DLL->SETUPAPI.DLL->SHELL32.DLL->EFSADU.DLL
Thanks in advance for any help,
Tony
|
|
|
|
|
The Depends utility does not show DLLs that are explicitly linked. It only shows those that are implicitly linked.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
David,
thanks a lot for that information.
Do you know any way (or tool) that shows only explicitly linked
DLLs?
Thank you,
Tony
|
|
|
|
|
|
Thank you very much.
I used Process Explorer and it clearly shows that my app uses
iphlpapi.dll but does NOT use EFSADU.DLL which was listed by
DependencyWalker as not present on XP Home.
I must say that I have never heard about implicitly and explicitly
linked DLLs but assume it means that some DLLs are never used although they might be imported in header files (those would be the implicit ones).
So I think, to know which DLLs I have to include when I want to
distribute my app, I have to do the following:
1) Run the app.
2) Use Process Explorer to see which DLLs it really uses.
I guess I would have to do this in different usage scenarios.
I have no clue how DLLs are loaded into memory, but could it
be the case, that some DLLs are loaded only after the App has started
(I mean until their functionalities are really needed by the app)?
Then this would mean I would have to run ProcessExplorer a few
times while I play around with the app to see if additional DLLs
are loaded.
3) Think about which DLLs are normally present on user's installations of Windows and add those that are likely not to
be present. I still regard this to be a hard thing since one
can never know what the user has and has not installed. Someone
was so kind and enlighten me a bit about this in another thread.
Thanks again for the answers, also to Prakash. Codeproject is a wonderful treasure of knowledge and helpfulness and I hope to give back some day when I have learned enough to do so.
Tony
|
|
|
|
|
Tony Westminster wrote:
could it be the case, that some DLLs are loaded only after the App has started
Yes, this is what LoadLibrary() and GetProcAddress() are for.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I dont think its possible to determine explicitly linked dlls, may be if you look into the exe file using some hex viewer software and search for dll you can find all the dlls that are linked explicitly and implicitly..
but then it also has some limitation for example, the utility regsvr32 loads the dll dynamically and the input dll is a parameter, here you can never determine which dll it is loading dynamically.
|
|
|
|
|
This is a warning about a DLL an operating system DLL uses. That operating system DLL is smart enough to not load the DLL if it isn't present. It uses the delay loaded DLL system to do this.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi
I currently want to use a function which takes in a BITMAPINFOHEADER as its argument. The problem is, I have to obtain it from a bmp file, and I don't know how I can obtain BITMAPINFOHEADER structure from the file.
I know I can use LoadImage function to load a bmp file, but as far as I know, in this case its return value is an HBITMAP handle, which is used to create a CBitmap object. I also know that we can specify the LR_CREATEDIBSECTION flag when we call LoadImage, although frankly speaking I am still unsure what it does. Is there a way to get BITMAPINFOHEADER from CBitmap? Or should I go take another route to get the BITMAPINFOHEADER?
Thanks!
|
|
|
|
|
Indrawati wrote:
...I don't know how I can obtain BITMAPINFOHEADER structure from the file.
CFile fileBitmap;
BITMAPFILEHEADER rBitmapFileHeader;
BITMAPINFOHEADER rBitmapInfoHeader;
if (fileBitmap.Open(strFilename, CFile::modeRead, &rFileException) == TRUE)
{
fileBitmap.Read(&rBitmapFileHeader, sizeof(BITMAPFILEHEADER));
fileBitmap.Read(&rBitmapInfoHeader, sizeof(BITMAPINFOHEADER));
...
}
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
My question is, I have been writing one simple VC++ program, which is related to file transfer using FTP software. I have FTP server software which is actually a third party software(exe file) and runs in one system. Through my VC++ program, i sending some FTP built in commands like Get,put..etc...
My problem is, to execute this FTP commands, i have used a command called "system" and the FTP console output redirected to one Text file. Ultimately i have to calculate the throughput, so now if i transfer the data only one time, then it is no probs, but when i transmit with counter continuously,
say for example, if count=10; transmit and receive 10 times and append the FTP console output in the same file. I have to read a particular line of FTP console output and there will 10 FTP console outputs, so i have to take the average number of bytes and secs. After that i need to display over gui.
Another problem is, when a customer finished the process for only one time and if he runs the program again, the FTP console output will be redirected to the same existing text file. Again i have to find out which the latest transmission and which is the line i have read.
could you please give me some idea to solve this simple issue.........
My question may be simple but i couldn't solve it since i am a learner.....
Peroz babu
|
|
|
|
|
This sounds like a job for sockets, specifically socket 21. Here are some examples.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|