|
|
Is it possible to get the HTML-Code from the Site wich is shown in CHtmlView and to use it in the program (extracting Links etc.) or to change the shown Site dynamically out of the Mfc-program.
shojo is back
|
|
|
|
|
There are many ways to do it. If you want to have a simple text with ALL code on the page, you can use the TextRange of tag.
But if you are processing the HTML, I mean extracting links, images, tables, etc., I suggest to use MSHTML library, it has good interfaces that do parsing for you.
Too big thing to discuss, so here is the link that talks about MSHTML on MSDN Web site:
MSHTML reference
Philip Patrick
"Two beer or not two beer?" <shakesbeer>
Web-site: www.saintopatrick.com
|
|
|
|
|
I'm trying to call a function from more then 1 project .
I do the following:
in one project i wrote:
int ChosenPort;
extern int GetPort(){return ChosenPort;}
from another i try to call the function:
int ChosenPort;
ChosenPort=GetPort();
I get a linking error:
error LNK2001: unresolved external symbol _GetPort
please help me if you can.
Thanks heaps.
Aviv.
avivhal
|
|
|
|
|
you have many options. here are a few:
1. copy the source files (and any appropriate header files) from the project where "GetPort" currently lives into the new project. pro: it's easy. con: duplication of source code.
2. put the files for GetPort into a new static library project and have each of your projects link to that library. pro: source for GetPort is in one place. con: takes a few minutes to set up.
3. put the files for GetPort into a new DLL project and have each of your projects use that DLL. pro: source for GetPort is in one place. con: takes a few minutes to set up; you have to ship a DLL.
i always go for option 2.
-c
Smaller Animals Software, Inc.
|
|
|
|
|
I can't load a function from my apps exe from one of my apps DLs:
(This code is from one article here on CodeProject I think...)
// I think it just to do the same when loading a function from a DLL.. but noup
static HINSTANCE hinstDLL;
typedef BOOL (CALLBACK *inshook)();
inshook instkbhook;
hinstDLL = LoadLibrary((LPCTSTR) "hodll.dll");
instkbhook = (inshook)GetProcAddress(hinstDLL, "installhook");
instkbhook();
The error is that Explorer crash... how to load a function from my exe?
It's a global function
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
1. Did you put the DLL same dir as the EXE
( If the explorer crashes you must be useing WinMe or earlier...)?
Did you exported it right?
DLL:
extern "C" {
void myFunc(void)
{
/*Function body*/
}
}/*extern "C" closing clauses*/
3. Check 'LoadLibrary()' and 'GetProcAddress()' return value
If it's 'NULL' The DLL/Function isn't found
Good Luck
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
The MSDN suggested:
The DLL:
********
#ifndef _INCLUDED_MYCLASS_H_
#define _INCLUDED_MYCLASS_H_
#undef AFX_DATA
#define AFX_DATA __declspec(dllexport)
class CMyClass : public CObject
{
DECLARE_MESSAGE_MAP()
//Class definition...
//
//
};
#undef AFX_DATA
#define AFX_DATA
#endif//_INCLUDED_MYCLASS_H_
************************************************************
In the my app:
**************
#ifndef _INCLUDED_MYCLASS_H_
#define _INCLUDED_MYCLASS_H_
#undef AFX_DATA
#define AFX_DATA __declspec(dllimport)
class CMyClass : public CObject
{
DECLARE_MESSAGE_MAP()
//Class definition...
//
//
};
#undef AFX_DATA
#define AFX_DATA
#endif//_INCLUDED_MYCLASS_H_
The DLL compiles fine, but my app gets unresoulved external about all
used methods. I assume, this for not writing "class AFX_EXT_CLASS MyClass..."
but when I do (DLL or my app) I get:
"error C2487: 'messageMap' : member of dll interface class may not be declared with dll interface"
What todo? Please be specific... 10X!
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
I use the AFX_EXT_CLASS and it exports the class fine.
==================================================
The Eclypse
|
|
|
|
|
I have an MFC dialog application and in its properties i assign it a menu. I thought "wow this is easy, i just make a menu and stick it on the dialog, i dont even have to write any code for it". But then i wanted to disable an item and found a problem. this is what i have:
void CMyDlg::OnUpdateMyItem(CCmdUI* pCmdUI)
{
pCmdUI->Enable(FALSE);
}
This disables the menuitem BUT! it doesn't show it disabled. It's like it does it in the background without redrawing the menu. Can anyone tell me how to work with the pointer and all so its updated correctly??
Thanks
(PS: i tried CMyDlg::DrawMenuBar(); , no effect)
Kuniva
|
|
|
|
|
You cannot use ON_UPDATE_COMMAND_UI in dialog. You should directly enable/disable menu items using CMenu class or use some tricks described in http://www.codeguru.com/dialog/index.shtml, CommandUI section.
|
|
|
|
|
UPDATE_COMMAND_UI doesn't work automagically in dialogs. You need to add a handler for the MFC message WM_KICKIDLE, and in that handler, call:
UpdateDialogControls(this, FALSE);
--Mike--
My really out-of-date homepage
Buffy's on. Gotta go, bye!
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
I tried to add the handler by clicking right on my dialog class and slecting Add Message Handler, but i cant seem to define "WM_KICKIDLE". How do i add a handler for a custom message like that?
Happy Newyearrrrrrrrrrrrrrrr!!!!!!!!!!!!!!!!!!!!! :p
Kuniva - Also a big Buffy fan, but mostly for Eliza Dushku (Faith)
|
|
|
|
|
With the good old GDI I have always used GetTextExtentPoint32() to get the width of a text string on the current DC.
Now I'm am playing around with Gdiplus::Graphics.DrawString(), but I can't find any function that tell me how many pixels my string is going to be (text width)
Any ideas?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You may have some success with the overloaded methods:
Gdiplus::Graphics::MeasureString(...) OR
Gdiplus::Graphics::MeasureDriverString(...)
/Andreas
|
|
|
|
|
Thanks a lot
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
i am new to C++ & Object Oriented concepts.
I came across the 'inheritence' chapter in my C++ book & have the following question.
Can a template class be used as a base class ?
thankyou all for replying.
sysdeamon
|
|
|
|
|
|
I agree!
|
|
|
|
|
|
|
I just discovered the "Format" tab of the Options dialog in MSVC++ 6.0 . I clicked on Source Window, and changed the foreground color of String to red, and voila!: all my quotation mark-enclosed strings in the source code view window are in red! I know this isn't a big deal for a lot of you; I had always known that you could change the colors, but I never knew you could color strings .
|
|
|
|
|
Thanks...I didnt know you could do that....it makes looking at the code easier.
==================================================
The Eclypse
|
|
|
|
|
Hey it's great
Thanks for the hint and a happy new year
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
What's the notification message that a list view control sends when the selection changes? I need the equivalent of LBN_SELCHANGE for the list view control.
Thanks,
Yury Sulsky
|
|
|
|