|
|
|
|
am too in NeST... i can c u wearing a grey shirt !!!
|
|
|
|
|
hello naveen, rnt u wearing a grey shirt or am i mistaken? plz reply.
|
|
|
|
|
|
|
But ur not a stranger for me
nave
|
|
|
|
|
|
|
When I compile a SUBROUTINE writen in fortran and link it to C++, a Message like this emerge out ": error LNK2001: unresolved external symbol _PEMV1@44"
and when I test the moule PEMV1.OBJ I found this text "_PEMV1@46".
the number of arguments to the subroutine are 10.
please could you tel me the source of this error?
mech:Yasir
|
|
|
|
|
The value after '@' stands for the size of parameters passed to PEMV1 subroutine. Since the value required by C++ linker differs from the effective value found in OBJ, it seems that the definition of the function in C++ and FORTRAN differs. You should compare not only the number of parameters, but their sizes too. You should investigate how FORTRAN’s data types are represented in C++. For instance, integer type can be represented by int , long and others. Try to change some of the types in C++ declaration of the function.
|
|
|
|
|
If you are using VC6 then look up "Mixed-language programming Topics" or "C calls to Fortran". Which basically means you may need to write a C wrapper in your program to call the Fortran code and then have the C++ code call the C wrapper. In Visual .NET I am not sure, but I do know that it is supported. I just do not know how to find it at the moment, as the information is harder to find in that help system.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I am trying to get a directory using using one of the shell function i.e. SHBrowseForFolder. Here is my code snippet:
LPBROWSEINFOW dir;<br />
LPWSTR DisplayName;<br />
int iImage;<br />
dir->hwndOwner = NULL;<br />
dir->pidlRoot = NULL;<br />
dir->pszDisplayName = DisplayName;<br />
dir->lpszTitle = L"Open folder";<br />
dir->ulFlags = BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS;<br />
dir->lpfn = NULL;<br />
dir->lParam = NULL;<br />
dir->iImage = NULL;<br />
SHBrowseForFolder(dir);
But as soon as I select a directory and press OK it crashes. Is there anything I am missing. Please help.
|
|
|
|
|
iLL eFFect wrote: LPBROWSEINFOW dir;
Your pointer is not initialized so it points to invalid memory address. Instead of using a pointer, use the structure:
BROWSEINFO dir;
dir.hwndOwner = NULL;
...
...
...
SHBrowseForFolder(&dir);
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Ok it worked some. But crashed at some other place.
Is there something that i have to do?
|
|
|
|
|
iLL eFFect wrote: Is there something that i have to do?
Yes: use your debugger. It will help you to track the problem.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
i cant even use the debugger... obviously that the first thing any developer will do.... the reason is that it is failing in gs_report.c
#if defined (_CRTBLD) && !defined (_SYSCRT)<br />
DebuggerWasPresent = IsDebuggerPresent();<br />
_CRT_DEBUGGER_HOOK(_CRT_DEBUGGER_GSFAILURE);<br />
#endif /* defined (_CRTBLD) && !defined (_SYSCRT) */
and there is no traceable path backwards.
-- modified at 6:06 Wednesday 14th June, 2006
|
|
|
|
|
The display name of the object selected is returned in the buffer pointed to by the pszDisplayName member of the BROWSEINFO parameter structure.
pszDisplayName
Address of a buffer to receive the display name of the folder selected by the user. The size of this buffer is assumed to be MAX_PATH characters.
BROWSEINFOW dir;
WCHAR wcDisplayName[MAX_PATH];
...
dir.pszDisplayName = DisplayName;
...
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
Thanks for the help. it did work.
|
|
|
|
|
Hey, i have a trouble for all. That is: For example: I want to write a function that display a messagebox with many param that i want. It should like this (like sprintf())
ms(HWND hwd,char *control_string,...){
static char *c[1000];
sprintf(c,control_string,???);
MessageBox(hwd,c,"ms",0);
};
Understand, but i don't know what ??? is ?.
If i have this function then i can call this function very useful like this:
ms(0,"%s%i%s",
"Untill now, I posted: ",
10000000000000,
" question!");
Is it useful?
|
|
|
|
|
You have to use va_arg , va_end and va_start macros. Try this:
#include <stdarg.h>
void ms( HWND hwd, const char * control_string, ...)
{
va_list argptr;
va_start(argptr, control_string);
char c[1000];
_vsnprintf(c, 1000, control_string, argptr);
MessageBox(hwd, c, "ms", 0);
va_end(argptr);
};
Hope it helps.
|
|
|
|
|
Try use this lines :
int EnhMessageBox(HWND hWnd, int mbFlags, LPCSTR pCaption, LPCSTR pTextFormat, ...)
{
va_list args;
va_start(args, pTextFormat);
int bufSize;
char pBuffer[MAX_PATH*4] = "\0";
bufSize = vsprintf(pBuffer, pTextFormat, args);
va_end(args);
return MessageBox(hWnd, pBuffer, pCaption, mbFlags);
}
Tantum possumus, quantum scimus.
|
|
|
|
|
what's vsprintf(...). Please tell me! I'm lazy.
Thanks for your help!
|
|
|
|
|