|
ATL is a set of classes (templated as well as non-templated) which implements a lot of boiler plate COM code.
STL is the standard library as defined in the C++ standard. It contains a number of container classes (lists, vectors, maps, etc), I/O (ostream, istream, fstream, etc), iterators, and algorithms (abstracted functions for performing operations, finding an element, or calculating a compound value over a (iterator) range of container items). I *think* that sums it up pretty well.
You should get books on the subject!
--
...Coca Cola, sometimes war...
|
|
|
|
|
Dear all
What is Callback? (difinition)
when is Callback being used?
Thanks
|
|
|
|
|
example:
you want to copy a lot of data.. (10000 GB)
this take a long time... and you want to
show some kind of progress for the user.
so the copy_function have a "callback" parameter,
that is a functionpointer to a function, you must suply. the copy_function calls from time to time your "callback" function, so you can show the progress to the user.
I hope, this helps.
|
|
|
|
|
wow9999 wrote:
What is Callback? (difinition)
Per MSDN, it's function that receives messages from the operating system.
wow9999 wrote:
when is Callback being used?
It's used whenever your application needs to be notified of something happening elsewhere. Some examples of functions that utilize callback functions are EnumFontFamilies() , EnumWindows() , qsort() , and RegisterClass() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Wt is the Differenc between these in MFC DLL wizard
1 Regular DLL with MFC staticaly linked.
2 Regular DLL using shared MFC DLL
3 MFC Extension DLL (uisng shared MFC DLL)
and where wwe use these
thanx
Regards.
|
|
|
|
|
i think you know what dll do,i can explain what the function of these three.
zahid_ash wrote:
Wt is the Differenc between these in MFC DLL wizard
1 Regular DLL with MFC staticaly linked
here,You create the dll with MFC dll staticlaly link to code.
Pros->You don't need to ship MFC dll with you dll as all required code is compiled with it.
cons -> can made dll bulky and take more memory usage.
zahid_ash wrote:
2 Regular DLL using shared MFC DLL
same way just viceversa of above.
zahid_ash wrote:
MFC Extension DLL (uisng shared MFC DLL)
here the most powerfull dll for vc++ appliction we can only export function form above two dll,but you can export classes using this DLL.
only disadvantage of this dll is that it export classes only to VC++ application whereas above two can export function other porgramming lanaguge
i hope you understand the concept
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I am working on this little clock program and I added notepad to it.
I wanted it to save notepad text to its one ini file
[BOX1]
Title=test1 remeber me
Hour=10
Minutes=1
AM_PM=PM
[BOX2]
Title=test2
Hour=3
Minutes=4
AM_PM=PM
[BOX3]
Title=test3
Hour=5
Minutes=6
AM_PM=PM
[BOX4]
Title=test4
Hour=0
Minutes=0
AM_PM=AM
[BOX5]
Title=test5
Hour=0
Minutes=0
AM_PM=AM
[BOX6]
Title=test6
Hour=0
Minutes=0
AM_PM=AM
[NOTEPAD]
note=dfsdfasdjf
fksjflasd;f
df;alsdf;ladsf
MY COOL NOTE PAD !!!!!!
when you open it again after you close it
you only see dfsdfasdjf
I know I need to add
note1=
note2=
note3=
note4=
here is my screenshot
http://dasher.psychz.net/~area51/notepadclock.jpg
|
|
|
|
|
Two solutions:
1) Keep the file nmae in the ini file and save the actual text seperate file
2) Use WritePrivateProfileStruct/GetPrivateProfileStruct.
3) is what you suggested above
|
|
|
|
|
Im not sure how to do WritePrivateProfileStruct
so here the code section.
not sure if i should add loop or not.
think the program will ended up in a loop
void CMyDigClockDlg::OnSavenote()
{
char sIniFile[MAX_PATH];
GetModuleFileName( NULL, sIniFile, MAX_PATH );
strcpy( strrchr( sIniFile, '\\' ) + 1, "reminderclock.ini" );
char notepad[MAX_PATH];
int loop;
CString temp_key;
assert(m_notepad);
///WritePrivateProfileString ("NOTEPAD", "note", m_notepad, sIniFile);
for (loop = 0; loop < m_notepad.Get; ++loop)
{
temp_key.Format ("note%2.2d", loop);
WritePrivateProfileStruct ("NOTEPAD", temp_key, (void *)&m_notepad, sizeof(notes), sIniFile);
}
}
|
|
|
|
|
ERRORS:
Compiling...
MyDigClockDlg.cpp
C:\-= My Stuff =-\-= programs =-\-= MY CLOCKS =-\MyDigClockTest\MyDigClockDlg.cpp(853) : error C2065: 'assert' : undeclared identifier
C:\-= My Stuff =-\-= programs =-\-= MY CLOCKS =-\MyDigClockTest\MyDigClockDlg.cpp(856) : error C2039: 'Get' : is not a member of 'CString'
c:\-= my software =-\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
C:\-= My Stuff =-\-= programs =-\-= MY CLOCKS =-\MyDigClockTest\MyDigClockDlg.cpp(863) : error C2065: 'notes' : undeclared identifier
Error executing cl.exe.
MyDigClock.exe - 3 error(s), 0 warning(s)
|
|
|
|
|
I am developing an MDI application in VC++. I need to create an MDI child menu attached to the Child Window without replacing the mainframe's menu. To be more specific my MDI Child window is using CFormView. I should be able to access both the child window menu and the main frame menu both simultaneously at a time. Can you please suggest any solution this.Please email to me if you have any useful relevant information on the above.
Madhavi
|
|
|
|
|
It's me again.
I'm still fighting with tabs.
I have 7 tabs with spins on them, and one Dialog.
I use Propertypage, and use the instruction "AddPage" to make the 7 tabs on the dialog.
Now I want to store the spin value in a flie when the user click and change the spin value.
(or maybe in 7 different file, for one tab own one file belong to itself)
Then, I have to communicate with a controller throu RS-232 under modbus portocol.
Because I'm slave on modbus, I only can send data out when the controller send out query message. So I planning to store the spin value in files, then waiting untill the query message, then I send the data I stored in the file.
I would like to ask how to deal with the file pointer.
I use the code:
in my base dialog' cpp:
<br />
FILE *filedlg;<br />
filelog = fopen( "file_page1.txt", "r+" )<br />
What code about pointer assignment I suppose to write in tab page1' cpp or h file to complete the rest? I mean page1 doesn't know the exitance of file pointer filedlg.
I'm new about pointer and MFC, and would be many appriciate about your help.
chauteen
|
|
|
|
|
Dear fellow Programmers,
I am currently facing a situation which I can not figure out how to do it.
I have a property sheet with 5 property pages. When the user press the IDOK button, I want to ensure that all Property pages has been visited by the user, all data on those pages has been entered properly and validated.
How can I do that? So far, I override the OnOK in each page, that function is only processing that particular page and exit directly.
Does anybody has any clue on how to solve this problem ? Please inform me and thank you beforehand.
|
|
|
|
|
Why not set it up as a Wizard instead of tab pages with a Next and Prev button. Enable Next when data validation determines everything has been done on the page and when the user gets to the end have a Finish button.
This is IMHO a better way to go if the user must visit all of the pages.
If you want to do it as tabs have a pointer to the property sheet in all the tabs and have a validation routine in the sheet itself. Each routine could then call
if (sheet->IsOK())
EnableWindow(IDOK);
and after each sheet is fully validated call
sheet->Valid(page_x);
Just some quick thoughts.
Dave
|
|
|
|
|
Thanks Dave,
I think I will try to change to the Wizard Mode and let the users look into it.
If they are not satisfied with it, I will change to the second alternative that you suggested.
Again, thanks for your fruitful information.
Alvin.
|
|
|
|
|
Your welcome.
If the users have to touch on all of the pages the wizard will be much easier for them. There is nothing like flailing around trying to figure out why the damned OK button won't enable!
Something to keep in mind. Will the wizard process be repeated often? Will it be basically the same values each time? If it is you either want to save the last values and restore them into the wizard each time it runs or allow the user to store them to a file that can be reloaded from the first or second page to refill all the values. This way the user can just hit Next,Next,Next to quickly repeat. I do this in one of my products where all of the files in each project usually have one format but each project will have unique settings for the files. It works quite well.
Good luck.
Dave
|
|
|
|
|
I am writing a activex control(MFC based) which will be embedded into an IE html page.I want to disable the IE menu(File->new),how can i do it?
please contact:
max_xiayi@hotmail.com
|
|
|
|
|
Hello CPians,
Anyone here ever tried loading a font from a font file(*.ttf)?
I need to theme my gui by using a user-created font. But I'm afraid once I send the app out, the user's pc will replace the font with the default font.
Thank you very much in advance.
|
|
|
|
|
What about installing the font as part of the application installation?
Watch out! I'm a CPian on the edge!
I have a new Gold rating and I'm not afraid to use it! -pete
|
|
|
|
|
"What about installing the font as part of the application installation?"
There's an idea.
But I just started using Visual C++ three months ago.
There are some things I still need to learn, like using the installshield.
I think i need to use installshield to do what you said.
Thanks a heap.
|
|
|
|
|
if you really want to do it that way, you'll need to use CreateScalableFontResource and AddFontResource. i'd just install the font as part of the app install - much easier.
Software | Cleek
|
|
|
|
|
Thanks very much.
I'll try to use these functions. Meanwhile, I am studying how to install a font, as generally suggested.
|
|
|
|
|
How do I access an URL from within the VB or VC++ code.
my requirement is, I need to create a DLL which accesses an URL, and parses the XML returned(the url I'm accessing returns XML, not HTML).How can I do that in VC++/VB?
Also, are there any classes in VC++/VB for parsing XML returned.
Any sample code would be appreciated.
Everything needs to be non .NET.
jmc
|
|
|
|
|
there are a whole bunch of xml classes here on cp that u can plug into your code and leverage to do what u want ... have a look in the relevant sections
"there is no spoon" biz stuff about me
|
|
|
|
|
One of the easiest ways to access web resources is using the MFC WinInet wrapper classes. Take a look at CInternetConnection and related classes. If that does not appeal to you can use the WinInet API directly or even the Winsock2 API to retrieve the web resource.
XML parsers are abundant. To see a large if not complete list of them go to xml.com. Perhaps the most prevalently used parser in Win32 from C++ is the Microsoft MSXML ActiveX control. I have been using it for around 4 years in C++ development. If you are familiar with ATL and _com_ptr_t class using MSXML with the #import directive is a snap.
Watch out! I'm a CPian on the edge!
I have a new Gold rating and I'm not afraid to use it! -pete
|
|
|
|