|
How do you mean ? Do you own the bitmap ? In what context is it being used ? Did you draw the text in the first place ? If so, just change the text colour and draw it again.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hello,
I would like to know how to create a excel file which contain
several sheet.
Thanks for help.
S.
|
|
|
|
|
|
G'Day Samprayoga
I was doing something similar just last week. There are a heap of knowledge base articles I found about this. Q179706 was the one I started with. From memory it has links to a more. Alternatively searching MSDN for 'office automation' should yield enough useful articles to get you started.
Good Luck!
Richard.
|
|
|
|
|
Hello guru's and here I go again:
I'm writing a dll that holds some of the data for my main program to work with. I have 3 functions in the dll which I want to access using GetProcAddress. Everything works perfect if I use the lib file for the dll and it's header in the main program - I call the functions and the and the work great. But if I call LoadLibrary, then GetProcAddress I get thousands of exceptions and my program crashes.
Here is how my functions are defined:
(1) Body
__declspec(dllexport) CString GetPriceString(int nNum)
{
...do stuff
}
__declspec(dllexport) int GetStringCount()
{
...do stuff
}
(2)Header
__declspec(dllimport) int GetStringCount();
__declspec(dllimport) CString GetPriceString(int nNum);
If I use the lib and header file for the above func. everything works fine, but if I don't and I really want to call the functions with GetProcAddress, it doesen't.
(3) DEF file
GetPriceSting
GetStringCount
(4) The way I use the GetProcAddress
CString (*GetPriceString)(int); // global
int (*GetStringCount)(void); // another global
(5) In the function
HINSTANCE hDll=::LoadLybrary("TheDll.dll");
GetPriceString=(GetPriceString)::GetProcAddress(hDll, "GetPriceString");
// Exception
GetPriceString(nNum);
So, if anyone can guide me of what I'm doing wrong - may be in the way that I construct the dll, or the way i call the functions, I'll be very thankful. Code sample appreciated also.
Greetings,
Deian
|
|
|
|
|
The functions get exported with their C++ mangled names. You'll need to look at your DLL's exports with Depends or Dumpbin to find the mangled names, and use those names in GetProcAddress().
You can also add extern "C" to the prototype to remove the C++ mangling (although I don't know if that will work because GetPriceString() returns a C++ object - try it and see).
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
hello,
is there a way to find the current users favorites directory ?
thanks
.
|
|
|
|
|
TCHAR szPath[MAX_PATH];
SHGetSpecialFolderPath ( CSIDL_FAVORITES, szPath, MAX_PATH, FALSE ); This requires the Active Desktop shell. On 95 and NT 4, use SHGetSpecialFolderLocation() instead.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
In my machine(win2000,mem 128)
when I use the sentence to allot memory,it show error in run!
unsigned char *pTemp = new unsigned char[600000];
but when I user
unsigned char *pTemp = new unsigned char[400000];
it is right in run!
why?
can you tell me how to allot a big memory ,like 1000000 char!
thanks in advance!
|
|
|
|
|
You shouldn't have any problems with allocating 600kb of memory. What kind of error are you getting?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm having a heckuva time with XP themes. I have two apps, one a shell extension DLL and one a standalone EXE, and neither one is getting themed properly on the release build of XP, but they work fine on beta 2 (which is all I have to test with). On both I've put an XML manifest in the resources, as described in MSDN. Dropping a .manifest file in the same directory as the binary has no effect.
I'm stumped... has anyone had this same problem (and more importantly, fixed it)?
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Did you put InitCommonControls(), or something like that, in the standard initialization?
-Matt Newman
-Matt Newman
|
|
|
|
|
I did, and #defined ISOLATION_AWARE_ENABLED as well... although would InitCommonControls() have any effect in a shell extension? I'd think Explorer would do that itself. ah well... I'll double-check my code to make sure.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
-= Matt Newman =- wrote:
Did you put InitCommonControls(), or something like that, in the standard initialization
I went back and added InitCommonControls() before my calls to DoModal(), but the dialogs still don't get themed. I'm just puzzled why it partially works on beta 2, because I must've been doing something right.
Ah well, can you think of anything else?
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
InitCommonControls();
I put it there I am using VC6 SP4 on Windows XP Home Edition.
Are you using MFC?
Is the manifest a type "24" resource?
(Yeah I know stupid questions but I had to ask)
Other than that I am pretty much stumped.
-Matt Newman
-Matt Newman
|
|
|
|
|
No MFC, it's all ATL and WTL. The manifest is type 24, with ID 2 (MANIFEST_RESOURCE_ID).
Thanks for the ideas, Matt. I guess XP users will have to go without the cuuuuuute round buttons.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
The resouce ID should be "1" (without quotes).
-Matt Newman
-Matt Newman
|
|
|
|
|
-= Matt Newman =- wrote:
The resouce ID should be "1" (without quotes).
It's 1 for EXEs, 2 for DLLs.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Hmm... Try 1 once. Other than that I am lost. You can just tell the users that the new theme is evil.
Matt Newman
|
|
|
|
|
howdy again all,
just wondering is there something i can call in MFC to bring up a dialog to let a user select a directory ? i was going to make someting myself but thought i would ask if there is something already in there.
also how do a catch the enter key being pressed ina CEdit ?
thanks for any help or pointers to the right direction
muz
|
|
|
|
|
1/ SHBrowseForFolder
2/ check Want Return/Multiline for the edit box
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
thanks for that, got the browsing working pretty quick, but i was asking how to make it do something when the user hits enter in the CEdit, not so its multiline, sorry for the confusion, again thanks in advance
muz
|
|
|
|
|
Then you still want to catch the return key, you want to override OnChange for the edit and check if the return key is down.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
oh i get ya, but after looking through the msdn i'm still having trouble checking weather they press enter or not, any good articles here on cp or other around, done a quick search and couldn't find any,
thanks.
|
|
|
|
|
Hi All,
I've been splitting one of my MFC apps into two parts recently (Service & Visual). I've written the Service as a NT Console type application but wanted to use such things as CStrings & also the COleDispatch object.
To do this I've included afxwin.h, afxext.h, and afxdisp.h.
My question is: is there any reason I shouldn't be doing this or should I be looking at using something such as the CNTService class on this site? (Hopefully there is no reason as otherwise I'll have to rewrite my code )
Richard.
|
|
|
|