|
arg.. i have been using .net since it shipped and now i have added a new dialog.. i right click on the dialog and say 'Add Class'.. specify the class name and set it to be derived from CDialog (instead of CHtmlDialog).. and click ok..
and it doesn't make the .h or .cpp or add the class to my project!!!
i have tried deleting the source safe files and setting all of the files to not be read only.. i have tried adding a dummy dialog and adding a class for it, and it will NOT make a frickin' class for any dialog at all now..
if i try to add a message handler for a button i have tried to make a class for it gives me a frickin' debug error in the 'script' since all of there dialogs are apparently html driven now..
arg.. i cant deal with making every dialog manually instead of having .net make the classes for me, its just too much of a pain in the arse..
is anyone familiar with this error, or can anyone give me an expectation of what to expect if i try to get technical support from microsoft?! i have spent the last 6 months developing this frickin' software and now i cant add any classes to any dialogs?! i thought this was perhaps a screwup in the .rc or the recourse.h, but i am not familiar with these files, and they seem to look the same for the new dialogs as they have for every other dialog ive ever made in .net
arg..
i cant make any classes from any dialogs.. plz give me advice as to what my next plan of action should be (besides manually adding these classes..).. arg..
-dz
|
|
|
|
|
|
i have copied the project onto 3 different machines with .net and all three wont let me add classes.. i can add a class, just not a class to a dialog.. i have tried going to the class view and adding a class there and setting it to a 'MFC Class' and to derived from 'CDialog' and setting the ID and hitting ok, and i get an error 'Object required'. I can edit dialogs which already exist, and I can add message handlers to them, but i cant make a new class for a dialog.. any other ideas?
-dz
|
|
|
|
|
Microsoft Paint can convert a monochrome bit map to color bitmap using the Save As funtion. Ho can do it using VC++?
Show me please!
Thank,
Vo Hong Hai
|
|
|
|
|
Hi!
I am writing an OCR program. I need to write a function to do the same like ExtFloodFill. If you know where to find the code, please show me.
Thanks,
Vo Hong Hai
|
|
|
|
|
Hello,
Is there a way to change the color of the progress bar in a CProgressCtrl for each separate instance? I've a dialog with several of these and would like their color to give additional information to the user.
Thanks!
JennyP
|
|
|
|
|
JennyP wrote:
Hello,
Hey, JennyP!
Check out the Progress Controls section of CP, i think you might just find what you're looking for...
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
First the RTTI question.
How is it possible to create an object without using MFC's CObject CreateObject() ...???
I checked out the source code (MFC) and could only determine CreateObject returns a Function*...???
Could someone please explain how I can accomplish similar code using plain old platform independent C++...??? Can I do this using RTTI...???
Second question.
I have asked this question before, but obviously didn't get it so i'll ask again...
How does MFC wrap a Windows window HWND with a class and avoid using global or static functions...???
Are they fancy MACROS...? if so where do I find these...???
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
for the second question:
you can have a look for winamp3.0 client src; this is free. u can get it form it's site, just use a defwindowproc
and in this function use getwindowlong to get extra data,
then we can do all the things we want.
|
|
|
|
|
ttzzgg_80713 wrote:
just use a defwindowproc
and in this function use getwindowlong to get extra data,
then we can do all the things we want.
Is that how the MFC framework implements this...?
How would you handle messages, would you hook the object...?
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
How is it possible to create an object without using MFC's CObject CreateObject()...???
Sure. Just use 'new CYourObject' or declare CYourObject as local/global variable. CreateObject stuff is needed, because framework needs to create objects of 'unknown' type. For example, if you have doc/view app, MFC creates CYourDoc and CYourView for you, but doesn't have full knowledge about these classes. You're just passing the RUNTIME_CLASS which, among other things, has the CreateObject method.
Hockey wrote:
I checked out the source code (MFC) and could only determine CreateObject returns a Function*...???
No, CRuntimeClass::CreateObject returns CObject *. There's also m_pfnCreateObject data member which has an address to function which is called by CreateObject.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
Sure. Just use 'new CYourObject'
This i knew...but I want to replicate MFC CObjects ability to create objects at runtime using CreateObject ...?
Like the DOC/VIEW in MFC, but I can't use MFC because I want to make my code cross platform...???
I did a little more reading an it turns out this isn't accomplished via RTTI...so i'm lost as to where to look...
I serach on google for objects dynamically and everything returns
CObject* pObject = new CObject;
Which is not exactly what I wanted to know...
I what I want to accomplish not dynamic creation...?
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I did a little more reading an it turns out this isn't accomplished via RTTI...
Well, it isn't accomplished with C++ RTTI (dynamic_cast, typeid, typeinfo). MFC has its own RTTI invented before VC had support for C++ RTTI.
Hockey wrote:
I what I want to accomplish not dynamic creation...?
I'm not sure what do you mean here. If you want to get universal method for creating objects based on class name, you may find this article useful: http://www.microsoft.com/msj/defaulttop.asp?page=/msj/archive/S385.htm[^]
The article is titled 'Roll Your Own Persistence Implementations to Go Beyond the MFC Frontier', but dynamic creation is the base for serialization. Any reading which takes on 'factory' design pattern may also give you additional understanding of this subject.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Tomasz Sowinski wrote:
I'm not sure what do you mean here
MFC DOC/VIEW uses a form of dynamic creation when instantiating the CView/CDoc derived classes however the dynamic creation is based on the new/delete operators...???
It uses a different method in creating objects dynamically...??
It is this method I wish to learn about...not the plain jane new and delete methods...
Thanx for the URL...i'll check it out...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
MFC DOC/VIEW uses a form of dynamic creation when instantiating the CView/CDoc derived classes however the dynamic creation is based on the new/delete operators...???
In the MFC slang, 'dynamic creation' is creation of object on heap given a class name (class name as a string) at runtime. However, deep inside, it always boils down to some 'new CYourObject' in your code. The MFC magic works with macros. Basically, if you mark CYourObject with DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE will have corresponding function which calls 'new CYourObject'. This function (along with class name) is hooked into list of available factory functions. Implementation of factory function is done for you by - guess what - IMPLEMENT_DYNCREATE.
So, you can look at the 'dynamic creation' problem like this: having a string with class name like 'CYourObject', you have to find a function which will call 'new CYourObject'.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
q1: Are you talking about dynamically creating an object at runtime?
q2. I think the answer to this is in MFC's Handle Maps. Have a look at CWnd::FromHandle()
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Neville Franks wrote:
q1: Are you talking about dynamically creating an object at runtime?
Yes I think...but NOT using new/delete
using something similar to MFC CObject but I can't use this method because I want to keep my code cross platform.
RUNTIME_CLASS macro takes a class and dynamically creates objects...I need this kinda functionality
But without MFC...
How is this accomplished...???
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Do a search on Google for stuff like "RTTI dynamic objects/creation", "C++ Persistance" etc. Also see what the various cross-platform libraries do to handle this.
It might be a good idea to post another question here stating what you are trying to achieve and asking people how they would go about. Dynamic creation of objects isn't something you need to do very often.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I want to write a wizard like "IE-->Internet connect wizard ",My method is that :
if (InsDWFirstDlg.DoModal ()==IDOK)
{
if (InsDWSecondDlg.DoModal ()==IDOK )
{
if (InsDWThirdDlg.DoModal ()==IDOK )
{
InsDWFourthDlg.DoModal ();
}
}
}
I find that there is twinkle
Do you have good advice or other good method ?
|
|
|
|
|
A wizard is just a property sheet with the wizard style set. Check out my hotfix checker in the System section, that's a wizard and should be a good starting point.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
thank you for your replaying .
I see it at once
|
|
|
|
|
I just got a copy of Visual Studio.net. Since I am new to programming I thought I would try building an app I have done in 6.0 so I could get a feel for the new lay out. I created a new class "CLine" for my drawing app and when I try adding functions like "CLine (CDC* pDC)" I get a message saying it's not a valid name. In 6.0 it works perfectly. Is there something I might be doing wrong? Any assistance and guidance would really be appreciated.
Thanks
|
|
|
|
|
can any body tell how to click a button using sedmessage method?
i did not know the last three parameters execpt HWND
plz explain last three parameters ?
r00d0034@yahoo.com
|
|
|
|
|
To reiterate a reply I made here:
The SendMessage function sends a message to the window procedure of a window. It doesn't return until the window fully processes the message. You should never send messages to windows of other applications because it is possible that the application may be hung and SendMessage will never return.
This is the prototype of SendMessage.
LRESULT SendMessage(
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
The hwnd parameter, as you know, is the handle to a window to which to send a message. The Msg parameter identifies what type of message to send, and the wParam and lParam parameters specify additional information about the message.
The system and applications communicate to windows via messages. Besides SendMessage, there is the PostMessage function, which sends a message to a window and returns immediately, making it ideal for communicating with windows in other applications.
To answer the second question, to programmatically simulate a button click, make the following call:
SendMessage(hwndBtn,BM_CLICK,0,0);
Peter O.
|
|
|
|
|
if the statement "using namespace" could be used to shorten the name to access to a certain function/variable.
Is there a similiar method to access to base class functions/variables in inheritance class functions , ie. to remove the front portion "base_class::" from "base_Class::base_class_func"?
|
|
|
|