|
What happens when you run this code
|
|
|
|
|
ooooooowkay !!
I removed the Rich Edit 2.0 from the Dialog and now i dont have an arror
Does this control has an error ?
Thanks !!
-- modified at 6:33 Monday 30th October, 2006
|
|
|
|
|
baerten wrote: Does this control has an error ?
No, but it does require to call AfxInitRichEdit() first.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It seems you get your answer AfxInitRichEdit now do you have any problem
|
|
|
|
|
Hello,
I am working with VS2005 and I use in a project a extern lib (MFC dll). In this library there is some template class and wenn I compil my project I get:
unresolved external symbol "__declspec(dllimport) public: void __thiscall MessVorgang<class messpoint="">::AddPoint(class MessPoint)
In my project MFC dll the class declaration is:
#include "stdafx.h"
#include "MessPoint.h"
template<class pelement="">
class AFX_EXT_CLASS MessVorgang
{
public:
MessVorgang()
:m_theIterateurDeList(NULL),m_id(0),m_fsTProjektId(0),m_dbStatus(0),m_type(99)
{
..........
..........
What I have to do or modify to fix my problem or were can I find information for template class in a Dll project?
Thank to help me!
AutreChien
|
|
|
|
|
Normally for development purposes, an external DLL comes with 3 files, a .h header file, .lib and .dll file. If you are using a library "MessPoint", you must include "MessPoint.h" in your source, and link the library "MessPoint.lib" during build time and ensure "MessPoint.dll" is in your compiled .exe directory or windows/system32/ directory during runtime.
The error is because you did not link the file. You can link it under configuration (VS2005) or just add the following code in the source
#pragma comment (lib, "MessPoint.lib")
Where MessPoint.lib is the library you want to link to.
Good luck.
|
|
|
|
|
Thank,
The messpoint.h is allready in the same MFC dll project like MessVorgang class:
declaration:
class AFX_EXT_CLASS MessPoint
{
public:
MessPoint();
...
That mean if I am good understand the messpoint is included in the same lib!
In the project were I am using this lib,dll is allready include in link-input(additional dependencies) to the lib (from MFC dll project)
What can I do to check if the messpoint class is really included or wath I have to change in my declaration.
AutreChien
|
|
|
|
|
If you are creating an MFC dll project, i suggest you to look for some articles in CodeProject. Anyway, if your DLL is structured like this
Project My.dll
class A<br />
{<br />
}<br />
<br />
class B<br />
{<br />
A a;<br />
<br />
}
Then in an application where you will be using Class A and Class B, you must link to my.lib. Just to tell you not to confuse yourself by linking to a.lib and b.lib, because that is not what your project created at the end.
If your DLL project contains template functions or classes, make sure you declare all possible variations that you want to use.
for example if you have this function
template <class T><br />
T GetMax (T a, T b) {<br />
return (a>b?a:b);<br />
}
you need to declare this too in the dll
template <class T><br />
int GetMax (int a, int b);
If you are going to call the int version of the GetMax function in the Dll. Compiling the DLL and later calling a float version (example : GetMax(float a, float b)) will cause an error, that the compiler cannot link to the function (of course, cause you didnot define it, and it doesnt exist).
However, if you just include the source during build time, no errors will be produced, because the compiler will be able to create appropiate functions during compile time. Templates are resolved during compile time. (Because a DLL is compiled earlier, all variation of template functions, classes etc must be declared and resolved too).
Good luck.
|
|
|
|
|
ok, I understand. I will try to change the declaration for my class, I am not very familiar with template ... I have to learn.
Thank you for your help !
AutreChien
|
|
|
|
|
hi,
can ne 1 help me bot how to use filelistbox concept in vc++.
thanx in advance,
zari
|
|
|
|
|
zareee wrote: can ne 1 help me
zareee wrote: filelistbox
This?[^]
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
zareee wrote: can ne 1 help me bot how to use filelistbox concept in vc++.
I cant understand what do you need?
|
|
|
|
|
hi,
i tell u clearly wat i need.i have a folder containing files of the same extension.i want the filenames to be displayed in the listbox and need to raise a event to retreive the contents of the selected file.i am using a mfc application.
can ne 1 help me?????????????
zari
|
|
|
|
|
You can use of DlgDirList it fills listbox with names of files and directories and also you can use filter files with last parameter of this function
what content of files you need?
|
|
|
|
|
Are you referring to MFC's CListBox::Dir() method, or the LB_DIR message?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
i tell u clearly wat i need.i have a folder containing files of the same extension.i want the filenames to be displayed in the listbox and need to raise a event to retreive the contents of the selected file.i am using a mfc application.
can ne 1 help me?????????????
zari
|
|
|
|
|
zareee wrote: i am using a mfc application.
So was my previous suggestion of any use?
zareee wrote: can ne 1 help me?????????????
Probably. Exactly which part are you needing help with (e.g., populating a listbox, responding to a listbox selection, determining what the current selection is)?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am tring implement Packet Sniffer.
How to extract all Details from bytes received to Network Card (in Packet Sniffer) ?
How to know data received throught which protocol?
|
|
|
|
|
To implement a packet sniffer you need to know protocols intimately!
Via Google this link will get you started...
Protocols[^]
|
|
|
|
|
Aniket Salunkhe wrote: How to extract all Details from bytes received to Network Card (in Packet Sniffer) ?
How to know data received throught which protocol?
look for iphelper apis or http://netsecurity.about.com/cs/hackertools/a/aafreepacsniff.htm
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
when I using COleDataSource::SetClipboard() function in MFC project is no problem, but in Win32 project(include MFC support) is error(Runtime Error! this application has requested the runtime to terminate it in an unusual way.)
why?
|
|
|
|
|
Hi all,
I wanted to know are there any methods/api available to get to know the VPN details. Am using MS Visual studio 2003 IDE. The application is built in vc++.
Any help or advices will be appreciated .
Thanks
Sunil
Sunil
|
|
|
|
|
To provide imageList is only Possible with CListCtrl ? It is not possible with CListBox ...
If Possible please help me for that by giving the steps to achieve it..
Thanks n Regards
Shikha
|
|
|
|
|
The list box is an older control and came before the imagelist was created, so no you can't get images automatically in a list box unless you do owner-drawing. But if you need images, it's a heck of a lot easier to just use a list view control.
|
|
|
|
|
thanks for your reply .....
Listview can i use it on the Dialog box?? i want it on the Dialog box ..
Thanks n regards
Shikha
|
|
|
|