|
Thanx,Actually I tried with it using OnNavigateComplete2().But I am getting Null when I call "IDispatch * pDisp = GetHtmlDocument();".
I also included <afxhtml.h> file.What is wrong with it.
|
|
|
|
|
Actually I want to make a desktop application like webshot desktop application. Can anyone give me a link or code for such a kind of application.
please help me out.
Thanks In advance
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
What is the need of ClassFactory ?
I mean The interface pointer can be obtained by using CoCreateInstance, then why to use CoGetClassObject.
|
|
|
|
|
CocreateInstance in used to obtain only single Object of the class. Whilei CoGetClassObject is used to obtain the multiple Object of the same Class.
And CocreateInstance automatically call the ClassFactory(). you don't have to care for it.
|
|
|
|
|
Firstly, as already mentioned, CoCreateInstance uses the IClassFactory interface to create the object. Secondly, IClassFactory has other methods besides CreateInstance . Finally, the class factory is allowed to implement other interfaces.
Steve
|
|
|
|
|
I have a mfc application,based on CDialog,developed with vc6.0. Now I have make its *.chm help file. But when I press F1, it will always shows "Cannot find the ... *.HLP file". How can I change F1's default help file's name?
Thanks in advance!
Peter
|
|
|
|
|
Override the WinHelp of App class (using ClassWizard)
- NS -
|
|
|
|
|
CWinApp has a member LPCTSTR m_pszHelpFilePath that is initialized before InitInstance() is called using a _tcsdup(), so you could free() the current m_pszHelpFilePath and _tcsdup() your own path in your InitInstance(). NOTE: during termination MFC will call free() on m_pszHelpFilePath assuming that it has been allocated using _tcsdup() so DO NOT set it to a static string.
-- modified at 3:30 Monday 17th September, 2007
If you are using VC6 then you will also need to override WinHelp either in theApp or in the mainFrame.
If you are using VC7 and above then forget the suggestion above and just call EnableHtmlHelp() in your WinApp constructor.
|
|
|
|
|
I am trying to build a CArray of structures. I need to define new TYPE using template.
I am lost in template syntax.
I got this so far
template <typename T>
struct Structure
{
CString word;
int frequency;
int weight;
int Category;
};
Can someone please help me with the rest of it? I am totally lost.
I need
CArray<MyType,MyType&> array;
Thanks for your help.
Vaclav
-- modified at 22:29 Monday 17th September, 2007
|
|
|
|
|
FYI
This compiles - hope it will also work
struct my_struct
{
int a,b,c;
CString s;
};
CArray<my_struct,my_struct> ca;
I just want to know why is the MS documentation leads me to belive I need to use template?
|
|
|
|
|
I does not work.
The ca "array" is an array of CString and I have no clue how to access the struct members.
|
|
|
|
|
Vaclav_Sal wrote: I does not work.
In fact your code was perfectly correct and that's the wey to do it (and you don't need to specify the second template argument because it has a default value). There are some articles here[^] about the STL, you'll probably find some usefull information.
|
|
|
|
|
Please note that in every program that wants to use the CFrame class in the Win32++ file will NOT be able to do so. there is a error as listed below.
In every example that has a call to the CFrame class (in Win32++) there is an error. Here's what my compiler says (VS 6.0):
c:\programming\codeproject api\demos\generic_all\win32++\frame.cpp(479) : error C2065: 'TB_GETSTRING' : undeclared identifier
In the CFrame cpp file (Frame.cpp) the error occurs in line 479 in the function "LRESULT CToolbar::OnCustomDraw(NMHDR* pNMHDR)" atg the line 479, ie:
BOOL HasText = (SendMessage(m_hWnd, TB_GETSTRING, (WPARAM) MAKEWPARAM (0,0), NULL) != -1);
Please advise me if you have a fix for this as soon as possible.
If anyone knows of the fix please email me directly at:
larryamillssr@hughes.net
A C++ programming language novice, but striving to learn
|
|
|
|
|
|
Hello,
I write differend data for then times with the same lengt to a file. I'm using one TEdit for this. Now I want to read the 4e data from this file and display it on a TEdit. How can I read data someware in the middle of a file.
Jelle.
|
|
|
|
|
What on earth is a TEdit ? What do you mean by 4E, is that the byte position ? An ifstream should do this just fine, I'd have thought.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: What on earth is a TEdit ?
I think it's Borland's version of CEdit .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can you tell me what is TEdit for read a file you can use of CFile class.
|
|
|
|
|
hey folks,
i stumbled across an assertion in my program. When I want to show a dialog modally the dialog is shown correctly, but when I close the dialog I get an assert:
"Debug assertion failed! ... program ...wincore.cpp line 882" which is:
void CWnd::AssertValid() const
{
if (m_hWnd == NULL)
return;
ASSERT(HWND_TOP == NULL);
if (m_hWnd == HWND_BOTTOM)
ASSERT(this == &CWnd::wndBottom);
else if (m_hWnd == HWND_TOPMOST)
ASSERT(this == &CWnd::wndTopMost);
else if (m_hWnd == HWND_NOTOPMOST)
ASSERT(this == &CWnd::wndNoTopMost);
else
{
ASSERT(::IsWindow(m_hWnd));
My code is farely simple:
CSelectionDlg dlg;
dlg.DoModal();
the thing is: I call this from a member-class:
-MyDialogDlg my dialog
-SomeClass m_instanceOfClass; a memberclass of dialog.
a function of Someclass does the above code
I found some stuff from microsoft:
http://support.microsoft.com/kb/194300/eng
which didn't work for my case!
if I add
ASSERT(::IsWindow(m_hWnd)); before the domodal nothing changes... so somehow my handle gets lost and I donnu what to do. can anybody help? maybe a simple link. i tried many links, although nothing worked for my case. I don't have any crazy stuff in my OnInit of the dialog nor do I have another dialog as model dialog
thx for your help
zqueezy
|
|
|
|
|
Did you try to trace your code line to line it seems you have a unvalid hwnd on your code.
|
|
|
|
|
well, as I said, the handle is valid before the DoModal-call! but somehow not during it
|
|
|
|
|
I would expect your ASSERT placed before the DoModal() to succeed, it just means that you are calling DoModal() from a CWnd derived class that has a valid Window, it has no bearing on the state of the dialog.
Are you calling DestroyWindow() somewhere in your Dialog class?
|
|
|
|
|
A easy to read time delay code in c++. What i can't understand is the role of clock() in the while loop where: clock()-start < delay. However i know the role of clock() in the program and i know the result of eliminating clock() in the while loop.But:
WHY CLOCK() - START ? clock() is as the same as the start and there is a type cast a line before , or i'm far far off the way ? Thanks
#include<iostream>
#include <ctime>
using namespace std;
int main()
{
cout << "Enter the delay time, in seconds: ";
float secs;
cin >> secs;
clock_t delay = secs * CLOCKS_PER_SEC; // convert to clock ticks
cout << "starting\n";
clock_t start = clock();
while (clock()- start < delay ) // wait until time elapses
; // note the semicolon
cout << " done\n ";
cin.get();
cin.get();
return 0 ;
int life()
{
in a land with no bird, no spring. My first journey was a
return 0;
}
|
|
|
|
|
Im not sure what you're asking ...
(1) clock_t start = clock();
(2) while (clock()- start < delay ) // wait until time elapses
at 1, start = t0
at 2, clock() is tn, that is, time increasing by whatever the resolution of clock() / the processor is running at
so in theory, no, clock() != start, clock() must be greater than start
Its not the most efficient way of delaying though .....
|
|
|
|
|
I think i just don't understand how all this hanging on
start = t0 and clock= tn but if start = clock() is an assignment so how could start = 0 ? becouse the clock() returns a value ( the time elapsed until now) to the start.
i try to read more about it on net and my book but i'm stil confused. No matter it's a important part of programming or not i don't like to read something and just move to the next chapter.
int life()
{
in a land with no bird, no spring. My first journey was a
return 0;
}
|
|
|
|