|
You have to change the bitmap pixels before you display them..
John
|
|
|
|
|
hi
How do i create CEedit cotrol dynamicly, withour resoruce editor,
i have crated a class subclass of CWnd
how do i add a CEdit and CStatic (label) control to it, where do i create it in OnCreate function ????
thanks
~dzenan~
|
|
|
|
|
Your question is not very clear: you have derived a class from CEdit and you want to create dynamically on your window? If so, just call Create:
CMyEdit NewEdit;<br />
NewEdit.Create(...);
Hope this helps
|
|
|
|
|
sorry for not clearing it up,,
I have a Class wich is derived from CWnd, now i want to put a Edit control on that window. how do i do that, or do i have to first create a class wich is derived from CEdit
thanks
~dzenan~
|
|
|
|
|
No sorry, I misunderstood your question, it's end of the day here !
So, that's a good question. I had the same kind of problem some time ago. I solve this by sending a user defined message to the window just after it was created:
CYourWnd Window;<br />
... Some code;<br />
Window.ShowWindow(SW_SHOW);<br />
Window.SendMessage(WM_MYUPDATE);
Then you have to add manually a handler for this message. In this function, create dynamically the objects.
Don't know if there is an easiest way ??
|
|
|
|
|
I see, will work on it
thanks
~dzenan~
|
|
|
|
|
Yeah, why not just override the Create function from the CWnd class and put it there?
[EDIT: Whoops, Iain Clarke mentioned that very solution below. ]
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
hmm well you dont need to create a class derived from CEdit.
Just Create a CEdit object in the OnCreate Event check out the code below
void MainFrame ::OnCreate(LPCREATESTRUCT lpcs)
{
CRect rect;
rect.SetRect(10,10,100,30);
CEdit *myeditbox = new CEdit;
CEdit *myedit = new CEdit;
myedit->Create(WS_CHILD|WS_VISIBLE,rect,this,300);
}
regards
Ahmed Ajmal
|
|
|
|
|
Here goes...
In your header:
class CMyWnd : public CWnd
{
...
protected:
CStatic m_StaticSubWnd;
CEdit m_EditSubWnd;
....
};
In your implementation:
int CMyWnd::OnCreate (LPCREATESTRUCT lpC )
{
m_StaticSubWnd.Create ("text here", WS_CHILD | WS_VISIBLE | SS_...,
CRect (0,0, lpC->cx, 24), this, 1);
m_EditSubWnd.Create ( WS_CHILD | WS_VISIBLE | ES_...,
CRect (0,26, lpC->cx, lpC->cy - 26), this, 2);
return CWnd::OnCreate (lpCreateStruct);
}
The coordinates are just examples. You can give them any coords you like.
You should handle WM_SIZE / OnSize and change the position / size of the subwindows when the size
of CMyWnd changes.
OK?
Iain.
|
|
|
|
|
It's working thanks
~dzenan~
|
|
|
|
|
I would like to know how I can add a DLL to my VC++ program?
I can do this easily in 6.0 version, what is the way in .NET?
Ehsan Behboudi
|
|
|
|
|
Create a DLL project in the same solution as the app,
change dependeces if you want for your app.
make so that .exe and .dll file is in the same direcotry, (change compiler settings)
import the header file to the .EXE project export functions in the .DLL project and you are ready to go
hope i didn't confused you know..
~dzenan~
|
|
|
|
|
i'm a little confused,
I made the vb DLL in vb6.0, I can do everything in the 6.0 version,
but now I just need to know how I can add the damn DLL to my VC++.NET application.
Ehsan Behboudi
|
|
|
|
|
ahaa Visual Basic,, hmm in that case i can't help sorry never did that, search articles maybe u can find something there.
i guess u have to import them uding .DEF files not shure
~dzenan~
|
|
|
|
|
Hi, I use resource DLLs to provide multilingual environment to users - user select language, I call AfxSetResourceHandle() with handle of relevant DLL and in all functions that load some kind of resource, I use AfxGetResourceHandle().
It works great (I have six resource DLLs now + base project, which is in english).
Of course I use same resource symbols in resource.h, with the same values.
But sometimes happens that I'm not able to load certain string from string table of one of DLLs. It has the same value assigned in resource.h as in all others DLLs but it just doesn't work. The only thing that helps that I must add new string to all DLLs and change the code to use this symbol instead of the old one.
I really don't understand what the problem is
What could be the reason?
Have you ever met some similar problem?
|
|
|
|
|
To prevent the whole world being rebuilt whenever a resource file changes, Visual C++ ignores changes to the resource.h header file.
You may find that a Rebuild All corrects this problem.
|
|
|
|
|
Rebuilding all didn't help..
|
|
|
|
|
Are all your resource files using the same resource.h file for their resource numbers, or are you adding new resources individually to each one?
I'm not sure how well Visual C++ copes with multiple resource files - it seems to think that a resource header will only be associated with a single resource file, which I noticed when trying to rename a resource file...
It might be better to define your resource numbers in your own header file; in the IDE, select View > Resource Includes, then add your own resource number file as a #include in the Read-only symbol directives box.
You'll have to declare the IDs manually rather than using the resource editor. You can use the resource editor once you've declared them.
|
|
|
|
|
All DLLs have their own resource.h file (but with the same content). So when I need add new resource, I just add the resource in MSVC++ Resource Editor and it does everything for me.
It's just confusing for me that all six DLLs are working well exceptiong the only one...
|
|
|
|
|
Hi guys,
I am doing a MDI application in VC6.0. A thread is created everytime a child window is created. The child window should display the user selected parameters. The problem I am facing is once a new child window is created, the parameters which are updated in the new window are also updated in all the previous windows. I am having seperate structure for mainting the data for each thread. But the child windows are getting updated with the latest data structure. How to bind the data structure to it's corresponding thread for that child.
Any body got some clue, pl suggest.
Thanks
Satya
|
|
|
|
|
When you create the thread it should be passed the HWND for the matching MDI child and update only that window.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
hello,
I have a problem ... I want to create a CDialog ... and add to it a toobar
i have tried
m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar.LoadToolBar(IDR_MAINFRAME);
where m_wndToolBar is a member of my CDialog class and IDR_MAINFRAME is the resource ID for my toolbar and... this code is in OnInitDialog event ...
the functions return OK but the toolbar isn't there ....
please help ..... thanks !!!!!!
|
|
|
|
|
m_toolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_TRANSPARENT , WS_CHILD |WS_VISIBLE | CBRS_FLOATING );<br />
m_toolBar.LoadToolBar(IDR_TOOLBAR);<br />
m_toolBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);<br />
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);<br />
|
|
|
|
|
|
Go to Administrative Tools > Services, double-click your service in the list, and fill in the Start Parameters box.
Your ServiceMain function gets called with these parameters when the service is started.
I assume OnStart is a framework-defined method (i.e. by ATL or whatever).
|
|
|
|