|
Has anyone got any code/example how to create/use a CListCtl with a CHeaderCtl using WTL? (NO MFC!!!)
Ignorance sould be pitied, not flamed.
|
|
|
|
|
Hi all,
I'm writing Dialog-base program ...
I have created Toolbar for my program ... (with CToolBar)
Now, i wanna set Tooltip for my buttons in the toolbar ...
I wrote this code, but won't work !
This code have not any error or warning but don't show tooltip !
Sometimes it crashes !
PLEASE HELP ME !
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT, 0, 0xFFFF, OnTooltips)
// 0 and 0xFFFF aren't my button's ID in my toolbar, i write below code too, but won't work
// ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT, IDC_BUTTON1, IDC_BUTTON8, OnTooltips)...
BOOL CLoanDialog::OnTooltips(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;
UINT nID = pNMHDR->idFrom;
if(pTTT->uFlags & TTF_IDISHWND)
{
nID = (UINT)(WORD)::GetDlgCtrlID((HWND)nID);
if(nID)
{
strcpy(pTTT->szText, "Hadi"); // I want to show Hadi string for all buttons ...
*pResult = 0;
return(TRUE);
}
}
return(FALSE);
}
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Toolbars supprt their own built in tooltips. You should be able to set them up as follows:
When creating the toolbar, and looking at the properties of each button, you can enter a string which is the staus bar prompt. The tooltip of the button can be entered in the format:
"Status bar prompt"\n"Tooltip"
Just set the associated text for each button.
You may need to call EnableToolTips on your toolbar to get he me to work. I have never used a toolbar in a dialog project, but it should work this way.
Roger Allen
Sonork 100.10016
|
|
|
|
|
Hi Roger,
I did thease works, but i have problem, still
Please help me !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I use CDaodatabase to open the mdb file,
I use the code follow:
try
{
m_db.Open(m_Source,FALSE,FALSE,_T(""));
}
catch(CDaoException* e)
{
e->Delete();
return false;
}
return true;
but every time it throw a error code
|
|
|
|
|
Since you haven't posted enough code we can only guess.
If you have kept the mdb open in Access , then Access has exclusive access. Close Access before running your code.
That might be the problem.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
That could be it, although, to my knowledge, Access 97 doesn't demand exclusive access to the .mbd it has open. At least, my application can read the database without any problems. Quite handy since i can modify the database in Access, and have my app redraw the results by invalidating the view.
Simon
Hey, it looks like you're writing a letter!
Sonork ID 100.10024
|
|
|
|
|
It works better (sharing wise) if you have your tables seperate from the code/views etc. Its also handy to have your queries external.
Access's own user login bit has never seemed to quite get the hang of sharing. With a sort of random selection of locking techniques, one record or whole table.
This all seems to be ok once your tables are seperated.
Another point, which will no doubt cause a scrap amongst us all, is that I tend towards a non Access data type. DBase IV is a favourite, since it can be made accessible from many different language/office apps and you have a wide range of ODBC drivers that your own code can use.
(I'll wait behind the bike sheds for the first up)
We do it for the joy of seeing the users struggle.
|
|
|
|
|
What is your Access database version ?
If you used Access 2000, then you must use AfxGetModuleState for solve it !
See MSDN !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Sorry ,I can't find the AfxGetModuleState function in MSDN
Can you show me how to use it?
thank you
|
|
|
|
|
One of member variables in AfxGetModuleState is about Database version, set it to 0x601 ... don't ask me WHY ? (it is because you are using Access 2000)
Then you can use Open function !
Bye, i'm now busy, sorry !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
We are developing application in wince.We need to rotate the screen 90.Is there any way to do this.we
are using the following code to achive this,But its not working in proper way
unsigned short buffer[240][320];
unsigned short * pusLine = (unsigned short *)GXBeginDraw();
for (unsigned int y = 0; y < gx_displayprop.cyHeight; y++)
{
unsigned short * pusDest = pusLine;
for (unsigned int x = 0; x < gx_displayprop.cxWidth; x++)
{
//*pusDest = PixelCol;
buffer[x][y] = *pusDest;
pusDest+= gx_displayprop.cbxPitch >> 1;
}
pusDest += gx_displayprop.cbyPitch >> 1;
}
GXEndDraw();
pusLine = (unsigned short *)GXBeginDraw();
for (unsigned int x = 319; x>0; x--)
{
unsigned short * pusDest = pusLine;
for(unsigned int y = 0 ;y<239;y++)
{
*pusDest = 255;
pusDest+= gx_displayprop.cbxPitch >> 1; }
pusDest += gx_displayprop.cbyPitch >> 1;
}
GXEndDraw();
|
|
|
|
|
- Sometimes I do not include certain .h file(s), but the app still runs ok. I do not know why. Are there any defaults .h file(s)?
- Can you give me an example?
- Best regards,
Maer
|
|
|
|
|
There are no default .h files, you're probably either including stuff you don't need, or you're including other headers that #include the other ones you need.
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
|
|
|
|
|
I am not sure about this Christian, but I think some headers are auto-inserted or perhaps they are in some pre-compiled format.
I use strcpy and strcmp without including string.h and I dont get errors.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
string.h is the basic_string class, I believe. strcmp and strcpy are both part of the core C++ which you get for free, i.e. without having to include any external libraries, such as stdio, iostream, list, map, etc.
I'm not sure on this, but I'd say that the stuff you get for free is some sort of superset of the stuff that comes with C, and that the whole point is one of not including too much above C as default, because I know Stroustrup worked hard to make sure C++ was not much bigger or less fast than C. This is one major reason ( and the one he usually gives ) as to why there is no garbage collection built into C++.
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.
I guess you are correct.
Because the moment you use an API call, you need to include the required header file.
I think most of the header files used by CRT functions are auto-inserted for us.
Some like "process.h" need to be manually included.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Nope, try this:
- Create an "Empty" Win32 Console app.
- Create a new file and add this to it:
void main()
{
char abc[4];
strcpy(abc, "abc");
}
- Save the file and add it to the project.
- Build.
You'll find that it doesn't work unless you include string.h at the top. Moral of the story: the C compiler does not include any default headers (unlike Java which always gives you the java.lang.* package).
Regards,
Alvaro
|
|
|
|
|
I had seen a VC++ sourcecode used DirectX but i got a compile error:"error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers".I can find the discussion about IDIRECTDRAW7 MSDN but there is no declaration in <ddraw.h>which sad in MSDN.
Would you please telling me where can I get the defination of IDIRECTDRAW7 that is it's defined in which header file.thanks.
Scratch
|
|
|
|
|
IN the DirectDraw7 SDK, now defunct, you'll need to download 8. One thing that sucks with DX is constant upgrades and inter-incompatible SDK's.
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
|
|
|
|
|
Yes,I have the latest SDK,but it is still there.My puzzle is where did Microsoft put the declaration of IDIRECTDRAW7?
Scratch
|
|
|
|
|
I got it.
Scratch
|
|
|
|
|
Is there a way to change the text size/font used in toolbars? I have created a number of classes to custom create toolbars derived from CToolBar and they work wonderfully. The only problem I have is that I don't know how to change the fonts of the text. Anybody with any clues?
TIA
Tim Dunn
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/CustDraw/CustDraw.asp
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hey all-
I have a huge project that has dependencies on approximately 18 other projects, all which are configured correctly through the depends section so that I should be able to just hit build and everything compiles (the exe and all associated dlls). Ok, this has been working fine for one version of the project, but I downloaded a new version from a different folder in sourcesafe, and I find that the compiler hangs, and can't be quit, no matter what. It's typically been limited to one of three files, that if I compile seperately, I can get the rest of the project to compile. However, if I do a rebuild all, it'll hit a file and as I said, cl.exe just sits there. I waited an hour, but it never came back.
What's worse is that I can't *kill* cl.exe, no matter what. I've tried kill from the Resource Kit, using the -f switch, which reports it killed it, but it's still there in the task list. What's worse is that it prevents NT4(sp6) from rebooting...I have to hit the power button to reset.
I've looked in the knowledge base, even on Google, but nothing comes up. The compiler heap (/Zm switch I think) is set to the max...2000, so in theory it's got all the memory it needs. I have plenty of disk space, and the machine has 256 meg of ram, dual processor.
This is making development very difficult...any help would be appreciated.
Ron
|
|
|
|