|
OK. Made some progress. I used the Depends tool that comes w/ VC++ and found out that the names of the exported functions are all messed up. That "SD_Create" procedure is actually exported as "_SD_Create@0". Now I'm at least returning a valid function pointer.
Is there any particular reason that the name is changed like that? And secondly, if I didn't use the Depends tool, how in the HELL was I ever supposed to come up with that?
-Mike Zinni
email: mzinni@rimail.com
AIM: zin9999
|
|
|
|
|
mikez99 wrote:
found out that the names of the exported functions are all messed up. That "SD_Create" procedure is actually exported as "_SD_Create@0".
That's not messed up, that's the usual name mangling taking place for PASCAL (aka __stdcall) calling convention functions.
|
|
|
|
|
No, thats not name mangling for C-style __stdcall calling convention, but is the name mangling of the C++ compiler (so called "decorated names").
The reason for this is that C++ supports overloading, but at link time every function identifier needs to be unique. So the C+++ compiler codes the numer and types of the functions arguments into the name and links against this name. The @0 in you case indicates a function without arguments.
Note that decorated names are always used if the functions are exported with __declspec(dllexport).
If possible you should link against the .lib file and so implictly load your DLL. You may also use the VC6 and above delay load feature.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
Why do I get an access violation when I try to get the value of the iterator "it" in this piece of code? When I look at the iterators they have no valid pointers to the strings.
typedef vector<CString*> TFileList;
typedef TFileList::iterator TFileListIt;
CStringList strlistFiles;
fsDlg.SelectFile(&strlistFiles);
int nFiles = strlistFiles.GetCount();
if (nFiles > 0)
{
int nIndex;
TFileList FileList(nFiles);
CString strFileName, strNewFileName;
POSITION pos;
for (nIndex = 0; nIndex < nFiles; nIndex++)
{
pos = strlistFiles.FindIndex(nIndex);
FileList.push_back(&strlistFiles.GetAt(pos));
}
TFileListIt start, end, it;
start = FileList.begin();
end = FileList.end();
for (it = start; it != end; it++)
{
TRACE("> %s\n", **it);
}
}
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Try *(*it)? (Just guessing ).
Best regards,
Alexandru Savescu
|
|
|
|
|
The problem is that my vector seems to be empty, even though I am filling it with valid pointers.
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Did you call size() to see if it is empty?
Best regards,
Alexandru Savescu
|
|
|
|
|
size() returns 8, but I have added 4 pointers to the vector.
I have noticed that the vector elements does not point to m_pchData of the string list elements I am using, but to some other address.
_First and _Last of the vector are updated when adding to the vector.
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Try not to store pointers, store CStrings directly. There is not much of a performance differnce since the CString does not get copied, its reference is increased.
Best regards,
Alexandru Savescu
|
|
|
|
|
Nah, didn't work either. The push_back seems broken...
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
It's this line:
Fredrik Skoog wrote:
TFileList FileList(nFiles);
This creates nFiles items initially empty and I guess NULL pointers. That's why you had 8 items, because 4 have already been created.
You shoud use:
TFileList FileList;
FileList.reserve (nFiles);
reserve allocates enough space, but does not create any items.
Best regards,
Alexandru Savescu
|
|
|
|
|
Yep, that's it. Thanks a million!
I think I'll have to hit the books now
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Hi...
I've a class MyClass which contain a member CFile m_MyFile.
I want to pass this file (open) to another class CMyOtherFile derived from CFile...
I tested while passing the handle of m_MyFile but that doesn't work (and it's not recommanded)...
Anybody can help me???
Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
If I understand you correctly, I think you should rethink your design strategy.
I think it might be better to pass the file name if possible.
Cheers,
Fredrik
<right>Sonork ID: 100.11430:PhatBoy
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
Of course... I've found another solution... A better solution...
Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi,
I have an MDI CFormView that makes itself the exact size of the outer frame, and resizes with it. However, you can still grab the right bottom edge and size the child viewform independently. I want this to not happen. The user should not be able to resize just the child form, only the outer frame with which the child form resizes faithfully as it is currently written.
Thanks,
ns
|
|
|
|
|
I think
cs.style &= ~WS_THICKFRAME;
in the child precreate is doing what I want. Thanks!
ns
|
|
|
|
|
Filter need some data before playing(about 170KB). Can the size be changed? Where do DirectShow handle it? Thank you!
|
|
|
|
|
I am currently working on an AVI player for inclusion in a program I am working on, and am using the ActiveMovie4 directx control. However, I am having difficulty resizing the parent window to the movie size. When creating the original movie window, I set the rect at (0,0,500,500), but depending on the video opened, the window doesn't stay that size. The rect, though, seems to not change, because when I use a GetWindowRect() function, it is still set at (0,0,500,500). How can I get the right size?
Graham, Compass Systems
|
|
|
|
|
When you say "the" rect, which rect do you mean ? Could you post your code ? I think you are mistaking GetClientRect() with GetWindowRect() . One of both returns you the size of the window defined in the ressource editor, the other one the "present" size of your window. So if you´re not using the good one, the window size may actually change while running your app but you are still asking for the original size in the ressource editor which remains of course unchanged. See what I mean ?
~RaGE();
|
|
|
|
|
I am using GetWindowRect(), but I also tried get client rect, and this resulted in the window being moved outside the main window that was creating the dialog box that contained the ActiveMovie Control, and it still gave me the wrong rect. Thanks for your help though...Any other suggestions?
|
|
|
|
|
Just post your code, pls...
~RaGE();
|
|
|
|
|
here it is:
video->Create(0,"hi",WS_VISIBLE|WS_CHILD,CRect (0,0,500,500),this,10);
video->SetFileName(opendlg.GetFileName());
video->Run();
//Resize dialog box to hold the movie window
video->GetWindowRect(avidlg.newrect);
avidlg.MoveWindow(avidlg.newrect, TRUE);
avidlg.UpdateWindow();
|
|
|
|