|
If the page has not been created then you can not call GetWindowText() on it, but you can get the caption from the tab control (CPropertySheet::GetTabCtrl() then CTabCtrl::GetItem() with TCIF_TEXT flag).
If you want it even before the sheet is created then there might be a way using FindResource(), LoadResource(), etc.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you. My choice is a FindResource(), LoadResource(), etc..
Best regards,
Eugene Pustovoyt
ICQ UIN: 161325180
|
|
|
|
|
Hello,
I'm sick of gray dialogs and windows. I'd like to skin my applications. However, I'm just a student and I can't afford buying professional skin system.
I'm looking for a free yet powerful and flexible skin system.
Can someone give me a link?
Thanks,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
|
Hi there. I have a question that has been unanswered for too long. Suppose I have an application that uses a DLL, and within that application, I need to pass a STL string to a class within the DLL. Have you tried that?? It blows up. Now, how can I get over this. This thing works until it leaves the function, making me believe that it is something to do with the release of the memory used by the string itself. Now, I know I could pass a pointer, or whatever, but this is just an example. Right now, I'm trying to get a class within the DLL ask the main app for a STL map, and the app fills up the map correctly, but just when the dll function exits, it blows up again. and again, error deallocating the memory. I've built two mini-projects with VS .NET 2003 for you to check it out. They're very simple and show this error. Can you give me a hint here? Thanks
the link to the projects is here
|
|
|
|
|
Almost certainly you are experiencing the classic mixed allocator problem. That's when you allocate memory on one heap and free it in another - This is bad - A crash is the best cash scenario as often it results in heap corruption and "blows up" some time later in some other part of the code leaving you scratching your head. The general way around this is to follow this rule:
- If you allocate memory in one module free it in the same module. You may have to export a free function from the module to achieve this.
Another approach is that used by COM - All the modules agree to use the same allocator (CoTaskMemAlloc and friends. You could implement this for STL strings by writting a custom allocator (the allocator can be passed as a template parameter).
Steve
|
|
|
|
|
Make sure that you link all modules with the dll version of C++ runtime library.
|
|
|
|
|
I print 2 base lines:
1) from (0,0) to (300,0) - horz base line
2) from (0,0) to (0,300) - vert base line
but they are not at topmost and leftmost of printed page - there are margins at top and left.
do you know how to adjust the base lines from C++ or hardware (printer etc) settings to delete the margins to let the 2 base lines at topmost and leftmost of printed page?
---------------------------
followins are MFC code, please do a testing for me: if your printers have margins also?
---------------------------
CPrintDialog cp(0);
if(cp.DoModal()!=IDOK) return;
HDC hDC=0;
hDC=cp.CreatePrinterDC();
if(hDC==0) return;
CDC*pDC=CDC::FromHandle(hDC);
int iMapMode=pDC->SetMapMode(MM_LOENGLISH);
DOCINFO docInf;
memset(&docInf,0,sizeof(DOCINFO));
docInf.cbSize=sizeof(DOCINFO);
pDC->StartDoc(&docInf);
pDC->StartPage();
pDC->MoveTo(0,0);
pDC->LineTo(300,0);
pDC->MoveTo(0,0);
pDC->LineTo(0,-300);
pDC->EndPage();
pDC->EndDoc();
pDC->SetMapMode(iMapMode);
-------------------------
thx
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Most printers can't print on the entire page. Lasers typically have a 'border' from 0.1 to 0.3 inches around the edge where they won't print. Ink jets are similar.
Software Zen: delete this;
|
|
|
|
|
I have a problem with this code, if anyone could please help me out, I would greatly appreciate it! I'm trying to make a program that has a certain number of 'char arrays.' When the program starts, it's supposed to randomly concatentate any of the two strings. My program has a problem in four lines of code, and I don't understand how to do it any different. Thank you for your time and help! (P.S., though this snippet of code only shows 4 different strings, my actual program will have at least 25);
//Test program. The object of this program is to
//have different strings randomly concatenate
#include <iostream>
#include <windows.h>
using namespace std; //or #include <stdio.h>, depending on the compiler
#include <string.h>
int main()
{
srand(GetTickCount());
char word[4][128]; //I want to store different strings into word[0], word[1], word[2], and word[3]
word[0][128] = "word1"; //This is set of four lines is where the problem is
word[1][128] = "word2";
word[2][128] = "word3";
word[3][128] = "word4"; //----end of the problem
int firstword;
int secondword;
firstword = rand() % 4;
secondword = rand() % 4;
strcat(word[firstword], word[secondword]);
cout << ""<< word[firstword] <<"";
cin.ignore();
return 0;
}
|
|
|
|
|
First problem: The line word[0][128] = "word1"; doesn't assign the string "word1" to word[0] , which is what I assume you want to do. These four lines probably shouldn't even compile, since on the left side of the assignment you are referencing a single character (word[0][128] ) and on the right side you have a string constant.
Second problem: You can't assign simple strings in the way you have. In C/C++, for simple strings, you use the strcpy() function.
Here's that part of the code, cleaned up:
strcpy(word[0],"word1");
strcpy(word[1],"word2");
strcpy(word[2],"word3");
strcpy(word[3],"word4");
Software Zen: delete this;
|
|
|
|
|
or try this
for(i=0;i<4;i++)
sprintf(word[i],"word%d",i);
Meinhard
|
|
|
|
|
Thank you so much everybody for your help! My program finally works thanks to your help!
|
|
|
|
|
You're welcome .
Software Zen: delete this;
|
|
|
|
|
|
I am "drawing" shapes in the user area of display and want to erase all that I drew to-date. I set the variable ShapeKind to the type of curve, i.e. bezel, points or, if points, I set them all to zero and then issue "Invalidate". This erases the screen of any lines that I have drawn to-date. However, I was told to set ShapeKind but do not know how it is used or called within the "Invalidate" statement, any comments to Sid Kraft at sid_kraft@msn.com. Thanks
Sid
|
|
|
|
|
Hi to you,
sorry about me very bad english. I'm looking for a way to include a html-based resource in a project and diplay it as an modless Window.
Can somebody help?
Meinhard
|
|
|
|
|
use below in your .rc file:
TESTID RCDATA "htmlfile.html"
and use it in your code. m_hInstance can be NULL.
HRSRC h = FindResource(m_hInstance, "TESTID", RT_RCDATA);
if (!h)
{
HGLOBAL f = LoadResource(m_hInstance, h);
void* mem = LockResource(f);
int size = SizeofResource(m_hInstance, h);
}
and cook it.
Enjoy
Anderson Sheen (exteide@gmail.com)
The Extension IDE: http://www.exteide.com
|
|
|
|
|
Thank you very much!!
I tried it and it works fine! But as a stupid I am, my question now is, how to put it on the sreen in a window?
Thank you for helping again.
Meinhard
|
|
|
|
|
|
Thank you for your answer. But the difficulties never ends. The linked sample is written for Vers 8.0. I'm unable to use, because I#m only owner of the 7.0 Version of VS.
Hope you would help me again.
All the best
Meinhard
|
|
|
|
|
|
thanks for all, it works fine !!
|
|
|
|
|
I have written a simple audio player that uses MCI to audition audio files from a Windows file dialog, as well as from our own graphic UI.
Unfortunately, since writing it we have learned that MCI does not support several audio file types, notably 24-bit files.
We'd like to rewrite the class to use WMP, but documentation for that technology is hard to find.
Can anyone recommend a way to use WMP to implement the following interface?
class AudioPlayer
{
public:
AudioPlayer();
~AudioPlayer();
void OpenFile(const tstring& strFileName);
void CloseFile();
const tstring& GetFileName() const;
void Play();
void Stop();
bool IsPlaying() const;
bool CanPlay() const;
};
|
|
|
|
|