|
Here is what I want to do
VB front end is main app
DLL # 1 creates an array of doubles
DLL # 2 performs some task on an array of doubles passed to it
Vb frontend will get a pointer to an array of doubles (double * array) from DLL #1 and pass the pointer to DLL #2 which accepts pointers to arrays of doubles.
How do I get VB to do this ie. recognize what a pointer to a array of doubles is??????
Thanks in advance for all help
|
|
|
|
|
Between dll's you can pass pointer like long value and inside the second dll you can assign this long to the real pointer and do the conversion
|
|
|
|
|
Thanks for the reply.
I thought about that but my ploblem is that the 2nd DLL(receiving the pointer) must have a (double*) as it's parameter. I can not redeclare the function to accept "void pointers". If I could, I would.
Any other suggestions?
|
|
|
|
|
Is it possible to add a hook to keyboard from a services
I want to add the hook when the service is starting and remove the hook when the service is stop.
I tried but the hook can not be installed.
Thanks
Florian
|
|
|
|
|
Yes you can, the only thing that you must consider is that a system wide keyboard hook must be placed inside a DLL.
Then you should create a DLL that contains the hook (the callback function) and remember that the service must have a mesage pump.
If you have more questions or if I have not been so clear, (or if I've completely missed the shot) don't mind to ask again.
Hope this helps...
|
|
|
|
|
Hi Everyone,
I have an application that is designed to load an image from the database. This image is in a compressed form like png, jpeg etc. I was wondering what is the process to loading the bitmap if it is already in memory (ie. not loading it from the disk)? Should I use something like FileMaps or something else?
Cheers,
Clint
|
|
|
|
|
there are a half-dozen articles on CP that handle image I/O. most of them can handle memory-based images. look in the "Bitmap and Palettes" section.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Hi Chris,
I did go through them, unfortunately they deal with their own classes. I would like to be able to use CImage (which supports decompressing png) from the MFC library. So what I need to know is how do I tell windows that this compressed png file is in memory and not on disk without having to save a temp file to disk?
Cheers,
Clint
|
|
|
|
|
i'm not familiar with CImage, but the MSDN says its Load method can take an IStream interface. so, you could hook up some kind of IStream-based COM object to read your memory-based image. (yeah, yuck)
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
How could I get the path of a APP.EXE ??
I need to open a Site with Internet Explorer browser. I have used the GetModuleFileName function, but I don't have the HMODULE parameter (to get HMODULE, the GetModuleHandle function also doesn't work).
Any idea ??
Thanks,
Cris.
|
|
|
|
|
|
Hello There!
If the app was put on your computer with an installer you don't need the path because it is registered in the registery automatically. You can just provide the name of the executable in ShellExecute(..) and it will launch the app.
However if you insist on getting the path use this:
char szRegBuf[200];
DWORD pcbData=199;
if(!::SHGetValue(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\TheExecutable.exe","Path",(LPDWORD)REG_NONE,szRegBuf,&pcbData))
{
AfxMessageBox("Successfuly located TheExecutable.exe path in the registry");
}
|
|
|
|
|
Ok, and abount the SHGetValue function ?? Where it is declared ??
[]'s
|
|
|
|
|
Hi Cris,
It is declared in Shlwapi.h.
Or you can use some other Registry access function if you want. I have the MSDN info for you if you wish. But once again you really don't need the path if you use ShellExecute(..) on an installed application.
Art
///////////////
From MSDN info
///////////////
SHGetValue
Retrieves a registry value.
DWORD SHGetValue(
HKEY hkey,
LPCTSTR pszSubKey,
LPCTSTR pszValue,
LPDWORD pdwType,
LPVOID pvData,
LPDWORD pcbData
);
Parameters
hkey
Handle to the currently open key, or any of the following predefined values: HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_DYN_DATA (Windows 95 only)
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA (Windows NT only)
HKEY_USERS
pszSubKey
Address of a null-terminated string that specifies the name of the subkey from which to retrieve the value.
pszValue
Address of the value.
pdwType
Type of value. For more information, see Registry Data Types.
pvData
Address of the destination data buffer.
pcbData
Size of the destination data buffer.
Return Values
Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.
Remarks
Note If your application must set/retrieve a series of values in the same key, it is better to open the key once and set/retrieve the values with the regular Microsoft® Win32® registry functions rather than use this function repeatedly.
Requirements
Version 4.71 and later of Shlwapi.dll
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later).
Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later).
Header: Declared in Shlwapi.h.
Import Library: Shlwapi.lib.
|
|
|
|
|
Is it possible to change the background color of a menu from white to gray eg. RGB(222, 222, 222) without having an owner drawn menu?
|
|
|
|
|
georgiek50 wrote:
Is it possible to change the background color of a menu from white to gray eg. RGB(222, 222, 222) without having an owner drawn menu?
I doubt it. You could try temporarilly changing the control panel colors, but this would effect all aplications and menus.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
You can do that with SetMenuInfo() and set a new background brush - only works on 98+ and 2000+ however.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Which comes first, the bug or the stress?" -- Chris Maunder
|
|
|
|
|
Thats quite strange that it wouldn't work with XP. I tried it anyways but even though the class members where showing up when I was filling in my MENUINFO struct the program failed to compile because MENUINFO was not recognized...Does this have anything to do with me running XP (I doubt it, I think...) and windows.h is included.
Regardless, what are some better alternatives to take care of XP Windows and below?
|
|
|
|
|
It does work with XP. I tried it on my XP machine and it works beautifully.
Are you declaring your CBrush object as a class member so it doesn't go out of scope?
Art
/////////////////
From MSDN
/////////////////
The MENUINFO structure contains information about a menu.
typedef struct tagMENUINFO {
DWORD cbSize;
DWORD fMask;
DWORD dwStyle;
UINT cyMax;
HBRUSH hbrBack;
DWORD dwContextHelpID;
ULONG_PTR dwMenuData;
} MENUINFO, FAR *LPMENUINFO;
typedef MENUINFO CONST FAR *LPCMENUINFO;
Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Winuser.h; include Windows.h.
|
|
|
|
|
Actually when I declare a MENUINFO struct eg. MENUINFO mi and then proceed to iniatilize the members of MENUINFO they are coming up on the classwizard (or whatever it is called). When I try to compile it though it does not recognize MENUINFO or SetMenuItem. I have included Windows.h. Are there any other headers necessary for it to work? (I am using Visual C++ 6.0)
|
|
|
|
|
I am using VC++ 7.0 but that shouldn't matter here.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
CMenu *pMainMenu=GetMenu();
if(pMainMenu == NULL)
return...
CBitmap bm1;
bm1.LoadBitmap(IDB_MENU); //I made a small gradient bitmap (IDB_MENU)
m_MenuBrush.CreatePatternBrush(&bm1); //m_MenuBrush is a CBrush
MENUINFO mi;
mi.cbSize = sizeof(MENUINFO);
mi.fMask = MIM_BACKGROUND;
mi.hbrBack =m_MenuBrush;
CMenu* pMenuSub0 = pMainMenu->GetSubMenu(0); //File
CMenu* pMenuSub1 = pMainMenu->GetSubMenu(1); //Edit
CMenu* pMenuSub2 = pMainMenu->GetSubMenu(2); //View
CMenu* pMenuSub3 = pMainMenu->GetSubMenu(3); //About
// TODO: Should do some error checks for NULL pointers...
pMenuSub0->SetMenuInfo(&mi);
pMenuSub1->SetMenuInfo(&mi);
pMenuSub2->SetMenuInfo(&mi);
pMenuSub3->SetMenuInfo(&mi);
}
Art
|
|
|
|
|
Netmeisters,
I need to write an SSL client in C++ for desktop Windows. I've read Rescorla's excellent SSL book and done a fair amount of SSL programming, using C and openSSL for Linux, eVC++ for the Pocket PC, and java. Although the Pocket PC project might seem similar, apparently WinCE provides quite different SSL facilities than desktop Windows. I haven't found any books on the subject (Rescorla explicitly avoids Windows) and I haven't found much on msdn.
So I'd really appreciate a pointer to some documentation that might help me get started. I'd like to know if desktop Windows provides facilities for SSL, and if so, how to use them. (If not, I'll just use openSSL.)
Thanks very much,
Matthew Fleming
mgf@mcw.edu
|
|
|
|
|
|
I have an array of property pages and I change their caption/title dynamically...
This works in the commented way, but when I try to do it using the non commented way, it crashes... (I'd like to know why)...
PREMISSES:
THE CASE THAT WORKS:
I have an array of property pages.
I have an array of titles.
Those two are members of the property sheet class.
THE CASE THAT DON'T WORKS:
I have an array of property pages.
I have one CString var declared inside the cosntructor of the property sheet class that will be used to store all the titles in the property pages...
THE CODE
{
...
this->m_ArrPPDlgParametritzacions[iNumPPags].m_psp.dwFlags |= PSP_USETITLE; <code>
this->m_ArrPPDlgParametritzacions[iNumPPags].m_psp.dwFlags &= ~PSP_HASHELP; <code>
csTitolPPag = ((char *)pxmlNode->attributes->getNamedItem("EtiquetaDescriptiva")->Gettext()); <code>
this->m_ArrPPDlgParametritzacions[iNumPPags].m_psp.pszTitle = csTitolPPag;
this->AddPage(&m_ArrPPDlgParametritzacions[iNumPPags]); <code>
iNumPPags++; <code>
} Any idea?
It's not a vital thing, I can live having an array of CStrings using memory, but it would be better to be able to do it without the array...
thank you in advance...
|
|
|
|
|
I would imagine that csTitolPPag is just a local string variable. The problem you are having is that
this->m_ArrPPDlgParametritzacions[iNumPPags].m_psp.pszTitle
is nothing more than a pointer to a character string. So when csTitolPPag goes out of scope, the string is deleted and thus pszTitle now points to trash.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|