|
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!
|
|
|
|
|
|
hi all
how to get notified when screen resolution changes
acc. to the res. i need to change the ctrl size in my app.
|
|
|
|
|
Maybe WM_DISPLAYCHANGE notification is what you need.
|
|
|
|
|
|
hi,
how to extract properties of msi file using msiexec ?
thanks,
Supriya
|
|
|
|
|
I think you have to write a program using the MSI API and open the MSI files yourself and do all the 'property extraction'.
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
I use orca.exe to get to the heart and soul of the MSI file.
Look for the orca.msi hidden in the windows 2000 resource kit directories. Install it and then you can right click on an MSI to view it's database for reading/writing etc...
-- modified at 18:51 Wednesday 14th June, 2006
Oops. I guess it's in the Platform SDK. My Bad.
|
|
|
|
|
how to leave space at the top and then add tabs in the property sheet
prashant jain
|
|
|
|
|
How i can minimise a Dialog on a button Click.
|
|
|
|
|
ShowWindow(SW_MINIMIZE);
whitesky
|
|
|
|
|
Thaks, but it isnot working in the WenCE.
|
|
|
|
|
Not working?? Did you pass the handle? or did you use this-> pointer? what's error message?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
I had used
if(m_bMinimize)
CMyDlg::ShowWindow(SW_MINIMIZE);
;
;
;
;
;
CMyDlg::ShowWindow(SW_SHOWMAXIMIZED);
This code is written in a button click of my Dialog.
The Dialog is minimised but it does not maximise again.
This is working fine in VC++ but does not working in WinCE
|
|
|
|