|
Rage wrote: You can embed a CToolbar normally in a dialog.
But I can't.
I made toolbar itself and toolbar variable
public:
CMainDlg(CWnd* pParent = NULL);
CMenu shlMenu;
CToolBar shlToolBar;
I inserted in OnInitDialog next lines
shlToolBar.Create(this);
int m = shlToolBar.LoadToolBar(IDR_TOOLBAR);
shlToolBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);
shlToolBar.ShowWindow(SW_SHOW);
but I don't see any toolbar.
May be I something forgot?
Or I need static control to place toolbar in and no way without it?
PS I tried to do exactly in reference, but all I got it's frame about toolbox. No any buttons.
http://x-14224.narod.ru/screen.jpg
-- modified at 9:19 Thursday 13th April, 2006
|
|
|
|
|
Your code works for me.
~RaGE();
|
|
|
|
|
All functions return TRUE but Dlg is not seen.
May be matter is my dialog is modeless?
If I surely not forgot anything?
I just added toolbar itself, toolbar member (public)
class CMainDlg : public CDialog
{
DECLARE_DYNAMIC(CMainDlg)
public:
CToolBar tb;
...
}
and that lines in OnInitDialog:
BOOL CMainDlg::OnInitDialog()
{
CDialog::OnInitDialog();
if(tb.Create(this))
{
if( tb.LoadToolBar(IDR_TOOLBAR1) ){
tb.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);
tb.ShowWindow(SW_SHOW);
}
}
I made no handlers but tb must already be seen at this stage IMHO?
PS Your code works for me. I begun aproach your code to mine and revealed next thing.
After commenting line
m_wndFormatBar.SetWindowPlacement(&wpl);
in your code your toolbar disappearing too.
So write just
m_wndFormatBar.Create(this);
m_wndFormatBar.LoadToolBar(IDR_TOOLBAR_FORMAT);
m_wndFormatBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);
m_wndFormatBar.ShowWindow(SW_SHOW);
is not enough to show toolbar. At least at mine comp.
I will investigate it on.
And thanks for example.
-- modified at 6:00 Friday 14th April, 2006
|
|
|
|
|
I read an article on the internet with the sentence:
----------------------------------
Vector fonts, on the other hand, are not device dependent, because each glyph is stored as a collection of scalable lines.
----------------------------------
my Q is:
what does scalable lines mean?
how to draw a simplest scalable line?
just LineTo() function?
or need some special settings?
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi,
Scalable lines are lines stored as vectors, i think...
For example in true type font, the letters are stored as a series of lines and curves with there relative co-ordinates rather than pixel data.
- NS -
|
|
|
|
|
How can i write and build a DLL under DDK for use?
is there any different between normal DLL and a DLL build under DDK(Win2k,XP)
Pls give me step by step direction
Thanks much
|
|
|
|
|
DDK ?
As far as I remember, DDK means Driver Devlopment Kit. And so, it has nothing to do with dll but with drivers (.sys). But I'm not an expert in that field so I may be wrong.
|
|
|
|
|
I want to customize USBView in DDK sample to a DLL and export function for displaying information in UI module written in MFC.
Pls tell me the way to do this.
Thanks
|
|
|
|
|
Did you read my post ?
You cannot change your USB driver into a dll. But what are you trying to do here ? Trying to export functions from your driver to be used by a MFC program ? That is totally crazy and breaks completely the architecture of the system.
Can't you retrieve this information by using DeviceIOControl ? Do you have some documentation supplied with the driver ?
|
|
|
|
|
USBView is not a driver.It is a program builded under DDK because it use structs and functions support belong to DDK.
|
|
|
|
|
fcoder wrote: It is a program builded under DDK because it use structs and functions support belong to DDK.
I don't think DKK is able to build something else than a driver.
What are those functions and structs ?
|
|
|
|
|
It has.. you can build almost everything with it, also DLLs and win32 apps.
You just need to create a sources file for it. Have a look at the sample applications coming with the DDK, there will be a sources file you can easily modify.
Don't try it, just do it!
|
|
|
|
|
Hi
When I creat a dialog and use the tool tip methods to show tool tips its working fine for all the controls. But when I changed the same application to in a DLL. where in a DLL funtion the dialog box will be displayed; the tool tips are not displaying.
Can any one tell the reason. and solution for it.
Regards
Anil
|
|
|
|
|
Hi people ::- ). I'm working at a wrapper over the Win32 API that will be able to create lots of types of windows, some with tons of special behaviors. This component will be open source and I'll post it here when it's going to be ready. One of the things I'm trying to do is to override how the window gets destroyed. To do this, I got to play a little with the close button of the window.
When one presses this button, the window dies directly. I want to integrate a special behavior which will give me total control of when the window should be destroyed completely. Of course, as you might have already guessed, since this is a Win32 API, I got full control of all messages BUT NO MFC. So how do you think I could override those WM_DESTROY messages?
Thank you in advance ::- D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I want to create a login screen and I'm trying to call another form. I have created the form called 'Dialog1' by using Project->Add Class->Windows Form.
In the main form, I tried to bring up the Dialog1 form by pressing a button using the following code:
#include "Dialog1.h"
Dialog1::Show();
but to no avail. Do you know what the problem could be?
it returns the error
error C2352: 'System::Windows::Forms::Control::Show' : illegal call of non-static member function
Much appreciated.
Nokoff
|
|
|
|
|
Hi Nokoff
Why don't you use Insert->Resourses->Dialog to create a dialog? I don't have much experience of Window forms as you have created.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
I think you need to read some books on C++ programing. This is something quite basic: you are calling a function from a class but you don't have an instance of this class. You try to call a function directly. This only works if the function is static (that means shared across all instances of the class).
|
|
|
|
|
Oooops!
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Aqueel, I don't even see an Insert-> in VC++ 2005.
|
|
|
|
|
Cedric, I've read quite some books on it but mostly the coding was all for VC++ 6 and I can't quite understand how to implement it in VC++ 2005 Express. Sorry if I'm being too n00bish, I was just looking for an honest answer.
|
|
|
|
|
Nokoff wrote: the coding was all for VC++ 6 and I can't quite understand how to implement it in VC++ 2005 Express
This is not related to the environment you are using but really to the C++ language itself. Maybe it would be good if you learn C++ firsts and then go through MFC (through visual C++). It will help you a lot to understand how everything works. But of course, this take time
Nokoff wrote: Sorry if I'm being too n00bish, I was just looking for an honest answer
I didn't want my post to be aggressive at all. Sorry if you understood it like that.
Anyway, I gave you an answer to the problem but if you don't know what a class is and how to use it (from what you posted, it looked like that, maybe it is not the case), this will be really difficult to help you.
|
|
|
|
|
Fair enough. I'll go do some more reading. Thank you for your time
|
|
|
|
|
I've been struggling with this for a while. I'm hoping someone can help.
Let's say I have a standard set of commands, namely, to write all changes to a text file. Now I want to repeatedly implement this block of code in my program without having to copy and paste the entire block of code. How can this be done?
This is an example of the code
StreamWriter^ rewrite = gcnew StreamWriter(file_path);
for (int i=0; i < listView1->Items->Count; i++)
{
rewrite->Write(listView1->Items[i]->Text);
String^ price = listView1->Items[i]->SubItems[1]->Text->Remove(0,2);
rewrite->Write(" ["+price+"]");
rewrite->WriteLine(" #"+listView1->Items[i]->SubItems[2]->Text+"##");
}
rewrite->Close();
Is it possible to store it in a dll file and call it from the code? Is it possible to store this code in another form or resource in the current project and call it as a function? How would I go about doing that?
If at all possible, take me through it slow, I'd really like to understand this concept.
Thank You for your time
Nokoff
|
|
|
|
|
Errr...
Why don't you use a function ? I don't really see what you want to do by using that in a dll.
|
|
|
|
|
I was hoping to find out how to declare the function in another c++ file or header and reference to it from the main form to make things a bit neater.
|
|
|
|