|
Hello All,
I want to write an MFC application where i want to enumerate different CAN hardware/or any such hardware like USB,PCMCIA,Serialport CAN's etc., and their information connected to my PC.Can you please let me know which functions i should use to get those.
Thanks in Advacne.
|
|
|
|
|
I have built an executable package in release mode in VC++.Net 2008(MFC). The package is running in my PC well but in other PC that doesn't have Visual stdio, is showing dll(mfc90.dll, msvc90.dll etc ) missing.
If I install Visual stdio 2008 redistribution package then it is working. Is there any way to run my package without installing Visual stdio 2008 redistribution package? How can I do this?
|
|
|
|
|
By statically linking to the MFC libraries and to the C-runtime libraries.
|
|
|
|
|
How can I statically link to MFC libraries and to the C-runtime libraries? will I copy all the missing dlls to the package?
|
|
|
|
|
Look a bit in your project settings (I never used VC2008 before).
For MFC, search for something like "Use of MFC" (it should be in the general section) and set it to "Use MFC in a static library".
For C-runtime libraries, look for "Runtime library" (it should be under "C/C++" category -> "Code Generation") and set it to the non DLL version (you have several choices there, take the one that is selected but without the DLL at the end).
|
|
|
|
|
I have done so but still dll missing message displaying.
|
|
|
|
|
I know there is 3 possible view states for any file in the windows explorer:
1) Thumbnails OR Tiles view
2) Icons
3) List OR Details
But within a PE file, there are more icons than this number. How can I realize which one or group of them is/are shown by the windows explorer?
Thank you masters!
|
|
|
|
|
Could you please direct me to a link or something to convert an RVA to File Offset in a PE file format? (Much better in the case of a Fuction or Class or something)
Thank you masters!
|
|
|
|
|
|
I've read it before! If you would read that you'd realize there's nothing to convert in that article but RVA to VA and NOT file offset!
Thank you anyway 4 Ur attention.
|
|
|
|
|
|
|
Hi,
I have exported one function from DLL, in that i am using "CFile fileObj", but compiler giving error:
CFile:undeclared indentifier , so is it possible to use file handling in DLL? what is the solution for that?
|
|
|
|
|
To use CFile, the DLL must be an MFC DLL.
Or you need to give MFC support to the DLL.
«_Superman_»
|
|
|
|
|
I'm giving you a 5 for answering a question like that. You have an awful lot of patience.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thank you Rajesh.
That is very kind of you.
«_Superman_»
|
|
|
|
|
Hi all,
I have 6 int values and a char buffer to pass another method. Something like this.
<br />
int MyClassOne::Method()<br />
{<br />
NemMwthod(1, 2, 3, 4, 5, 6, buffer);<br />
}<br />
<br />
int MyClassTwo::NewMethod(int a, int b, int c, int d, int e, int f, char buffer)<br />
{<br />
}<br />
Seems it's odd to me. So I do the following.
int MyClassOne::Method()<br />
{<br />
int* arr = new int[6];<br />
arr[0] = 1;<br />
arr[1] = 2;<br />
arr[2] = 3;<br />
arr[3] = 4;<br />
arr[4] = 5<br />
arr[5] = 6;<br />
<br />
NemMwthod(arr, buffer);<br />
delete[] arr;<br />
}<br />
<br />
int MyClassTwo::NewMethod(int ar[], char buffer)<br />
{<br />
}
I want to know what's best way to workaround is.
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
In my opinion, both methods are good.
I would prefer the first one, because it involves less copy operations.
As long as there is a fixed low number of integers to pass to the called procedure, the fist one is the best.
If the number of integers is variable, the second one is better.
An intermediate method would be:
int arr[6];
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;
arr[3] = 4;
arr[4] = 5
arr[5] = 6;
NemMwthod(arr, buffer);
|
|
|
|
|
You can use
vector or CSimpleArray and pass that as a function parameter.
|
|
|
|
|
They are both legitimate, anyway IMHO the first one is more reliable, since the second one may crash your application if the caller passes an array having the wrong number of items (i.e. array size < 6).
Note that you may force the correct behaviour this way:
struct MyMethodArg
{
int arr[6];
char * buffer;
};
int MyClass::MyMethod(MyMethodArg arg)
{
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for all the comments, make sense.
But actually that method is call large number of times, say 50 times in one second. The way I workout is fine? I'm testing it, so far so good.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Which way?
If you use the array then you may choose to allocate it on the stack, instead of the heap, for instance
int a[]={1,2,3,4,5,6};
MyMethod(a,buf);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ya, but I've clear the head once pass the array.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: Ya, but I've clear the head once pass the array.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry sir, it should be heap.
I appreciate your help all the time...
CodingLover
|
|
|
|