|
|
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)
|
|
|
|
|
Hi, how to set form/control width and height in VC++ IDE or in code? I mean, if i want it
to be exactly 100x200pixels, how do i do that? Is there anything similar to Visual Basic?
I have a simple program that adds two numbers in array using MMX (inline assembly), the program works fine, the code as shown below,
The result on screen is :
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
which is correct,
however, if i change the line
char incamt[]={u,u,u,u,u,u,u,u};
to
char *incamt;
incamt=new char[8];
for(int j=0;j<8;j++) incamt[j]=u;
the program compiles but the result is wrong! Why is that?
Output:
9 82 117 68 17 18 19 20 17 90 125 76 25 26 27 28 25 98 -123 84 33 34 35 36
#include "stdafx.h"
#include <iostream.h>
void main()
{
const u = 5;
//an array of increment amounts to aid SIMD-style operation
char incamt[]={u, u, u, u, u, u, u, u};
//instr is an array of 24 bytes
char instr[]={65,66,67,68,69,70,71,72,73,74,75,
76,77,78,79,80,81,82,83,84,85,86,87,88};
//the following is an embedded assembly code which
//uses MMX instructions to add in parallel the
//amount u to all the bytes of the array instr
__asm
{
movq mm1,incamt //mm1 has value u in all its 8 bytes
mov cx, 3 //initialize loop count
mov esi, 0 //initialize index register
L: movq mm0, instr[esi] //mm0=next 8 bytes from instr
paddb mm0,mm1 //parallel add 8 bytes of mm0 & mm1
movq instr[esi],mm0 //move result to instr
add esi, 8 //update index register
loop L //loop back
emms //empty MMX state
} //end of assembly code
//C++ code to output the results for verification
for (int i=0;i<24;i++) cout<<int(instr[i])<<" ";
="" cout<<endl;
="" just="" to="" pause="" the="" screen
="" cin="">>i;
} //end of main
|
|
|
|
|
Hi,
I have a bit of code that works fine in non MFC C++ project. However when converting to MFC code I get the infamous C2664 compiler error. This is what I'm trying to do:
<br />
double CWork::Equation(double x[])<br />
{<br />
return (100*(x[1]-x[0]*x[0])*(x[1]-x[0]*x[0])+(1.0-x[0])*(1.0-x[0]));<br />
}<br />
<br />
double CWork::DriverFunc(double (*dblfunc)(double[]), double start[])<br />
{ <br />
min = lots of operations;<br />
return min;<br />
}<br />
<br />
void CWork::WorkIt()<br />
{<br />
double start[] = {1.,2.,3.};<br />
double min;<br />
int i;<br />
<br />
min=DriverFunc(Equation,start);<br />
}<br />
This is the error: Work.cpp(1041) : error C2664: 'DriverFunc' : cannot convert parameter 1 from 'double (double []) const' to 'double (__cdecl *)(double [])'
Any suggestions would be great.
Kash
|
|
|
|
|