|
Hmm, I'd start by looking at the exporting Dll with some tools like Depends.exe for example that can examine the headers for exports. PEViewer is knocking around which can dig really deep if you need to. If it's not a calling convention issue it could be name mangling, some calling conventions add all sorts of goo to export names and it's different on different Compilers. Also make sure that all the types in the function interfaces are present and identical on both sides of the call otherwise nasty things will happen to your stack. Ouch!
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Dependency Walker tells me that I actually export two symbols : Function_ADD@12 and Function_SUB@12 ...
In my DLL's code the functions are Function_ADD and Function_SUB , so it appears that mangling has been done ( ) ...
More , the Dependency Walker states that the symbols are exported , at least it seems , in an ordinal way :I see the "ordinal" field with the values "1" and "2" respectively for the two functions ...
But I'm not using a .def file ....
About the calling conventions, I tried to force the __stdcall both in the project and in the code , but nothing changed (I've read somewhere that you have to declare the function, and then call them. as __stdcall ) ....
Anyway I don't think there are stack problems since my calling program doesn't ever crash , it simply warns me that it didn't find the entry points : that's way I'm quite convinced that something goes wrong in the export....
As you suggested, I'll try to use PEWiever to see if i can understand something more ...
|
|
|
|
|
tiwal wrote: Dependency Walker tells me that I actually export two symbols : Function_ADD@12 and Function_SUB@12 ...
In my DLL's code the functions are Function_ADD and Function_SUB , so it appears that mangling has been done
The extern "C" block prevents the above.
I've built a little sample DLL exporting a single function (see my reply
http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2376287[^]) and no-mangling appears in dependency walker.
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.
[my articles]
|
|
|
|
|
Are you sure those two functions are actually being exported?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well, all I can say is that Dependency Walker finds two exported symbols, just what I meant to do ...
but the way they are exported, is a totally different thing ... It seems they are exported in an ordinal way , when instead I wanted to use them explicitly (that is , without .lib reference)
|
|
|
|
|
Does the name in the export table exactly match the argument that you are passing to GetProcAddress()?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no it doesn't...after all I expected (incorrectly) that the name to pass to GetProcAddress() would have been the same , be it a c function or a cpp function ....
As I pass a mangled name , it does work perfectly ....
|
|
|
|
|
First I must say Happy New Year however today is 3 january but did you get my mail?
|
|
|
|
|
Yes, I received your e-mail.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
In effect much of my coding is based on such articles , and of course on MSDN too ...
But seems like there's something at a lower level to be analized ....
|
|
|
|
|
Hello everyone,
I have several physical file and I want to use file map (MapViewOfFileEx) to map the file into memory to improve performance. Each file is about several hundred M bytes. All the memory mapped files are kept open during my application.
The mapping is successful, but the strange thing is,
1. the performance to access the files which are opened at first is very fast;
2. the performance to access the files which are opened later is slower and slower (the performance to access the 10th file is very bad).
Any ideas to improve performance?
thanks in advance,
George
|
|
|
|
|
Buy memory.
Probably memory is swapped again to disk.
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.
[my articles]
|
|
|
|
|
More RAM is the only true religion when it comes to this sort of performance. If you have plenty and aren't getting the performance anyway then try fiddling the size of something called Non-Paged Pool. This is memory that doesn't get swapped out, ever, so be careful. I've seen this trick used on a dedicated system to allow a 2GHz Pentium 4 to do 16 simultaneous audio transforms and recordings off a bunch of 100MB Ethernet cards while serving the audio over the Web. Is that my PCI bus I can smell burning
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
All,
I have a doubt whether two different threads can be working on a same socket descriptor(handle in windows terminology)?
Please go through the following scenario:
We have one device which supports TCP/IP:
1. Responds to the requests
2. Sends notifications, incase any events
Can I have two threads one for continuesly wait to receive the notifications & response and another for sending the requests to the panel?
Could someone please provide (link will suffice)a good design for this class.
Best Regards,
Pratap
|
|
|
|
|
Raj Prathap wrote: Can I have two threads one for continuesly wait to receive the notifications & response and another for sending the requests
You can read from the socket in one thread and write to the socket in a different thread. I think that is what you mean and Yes you can.
|
|
|
|
|
Read with one thread and write with another is fine with one proviso. If you're unfortunate enough to be using MFC Sockets then don't pass the handles (Which are actaully Window Handles) between threads lest they suddenly and magically become invalid. It can be done but you'll need to root around in the MS Docs to find how to do it safely. If you're writing this sort of thing you might want to check out IO Completion Ports, a bit mind bending but they can make multithreaded socket apps a lot slicker.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi all,
I am working on a 3D game and have recently bought a book which is dedicated to collision detection. The book is very good and covers a lot of different topics. However, it completly lost me when it said "Barycentric Coordinates"...the book doesn't describe them, and I am having difficulties finding anything which I can understand via Google.
So if anybody here is able to explain that would be great!!
1. What are barycentric coordinates?
2. Are they just for 3D graphics?
3. When to use them?
4. How to use them?
I guess I'm after an idiots guide to barycentric coordinates. If it helps, I understand vectors, matrices, trig, and a lot of other A-Level maths. But barycentric coordinates are way beyond me
Thanks!
Lea Hayes
|
|
|
|
|
lhayes00 wrote: 1. What are barycentric coordinates?
I think it refers to the coordinates relative to center of mass of the system ( well barycentre conceptually differs from center of mass, but it doesn't probably matter here).
See for instance
http://en.wikipedia.org/wiki/Center_of_mass[^].
lhayes00 wrote: 2. Are they just for 3D graphics?
No.
lhayes00 wrote: 3. When to use them?
Using CM coords usually simplify motion equations.
lhayes00 wrote: 4. How to use them?
You have to:
(1) calculate the position of the center-of-mass of the system (say CM ).
(2) express all the coords relatively to CM .
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.
[my articles]
|
|
|
|
|
|
lhayes00 wrote: Thanks for the link. Via that wiki link I found the one below. How are there 3 ordinates per coordinate on this 2D triangle?
(please reformulate)
However maybe that Barycentric Coordinates really refers to the following, rather specialized concept
http://mathworld.wolfram.com/BarycentricCoordinates.html[^]
You can also try to ask the guys of the Graphics forum.
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.
[my articles]
|
|
|
|
|
Hi,
In my application, I have to use a rich edit control which will only accept numeric values. It should not allow the user to enter the text i.e the when the user presses any alphabets..rich edit should not display.
Any pointers would be greatly appreciated.
|
|
|
|
|
Hi
Go to richedircontrol properties..change readonly property false...
#sanroop#
|
|
|
|
|
johnalek wrote: change readonly property
|
|
|
|
|
Then it would not be possible for the user to enter anything in the rich edit control through the keyboard if it's a control with Read Only Property set to true.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|