|
An example of the code that doesn't work as you expect would help...as well as a clear statement of exactly what you expected.
If you (for example) added a new overload of DDX_Text , then the definition of DDX_Text in your class will hide the definitions in the base class. To fix this, you'd add the following line to your CWinDataExchangeEx class:
using CWinDataExchange<T>::DDX_Text;
|
|
|
|
|
this is my added code (I am trying to implement a DDX_CBSTRING function ala MFC):
(in my atlddx2.h)
namespace WTL
{
#define DDX_CBSTRING(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_CBString(nID, var, sizeof(var), bSaveAndValidate)) \
return FALSE; \
}
template <class T>
class CWinDataExchangeEx : public CWinDataExchange<T>
BOOL DDX_CBString(UINT nID, _CSTRING_NS::CString& value, int , BOOL bSave )
{
}
};
};
then on the dialog class:
#include "atlddx2.h"
class CScaleEditDlg :
public CDialogImpl<CScaleEditDlg>,
public CWinDataExchangeEx<CScaleEditDlg>
{
BEGIN_DDX_MAP(CScaleEditDlg)
DDX_CBSTRING(IDC_SCALE_MODEL, m_strModel)
DDX_TEXT(IDC_SCALE_DESCRIPTION, m_strDescription)
DDX_INT_RANGE(IDC_SCALE_SA, m_nStationAddress, 0, 999)
DDX_CONTROL_HANDLE(IDC_SCALE_IMAGE, m_ctlImage)
END_DDX_MAP()
};
None of the base class DDX routines seem to get called, e.g. DDX_TEXT, DDX_INT_RANGE, etc. I set breakpoints in DDX_Text() and all others but only the DDX_CBString one gets hit.
Could it have something to do with the way the macro's are defined? They are defined within a function body:
(from atlddx.h)
#define BEGIN_DDX_MAP(thisClass) \
BOOL DoDataExchange(BOOL bSaveAndValidate = FALSE, UINT nCtlID = (UINT)-1) \
{ \
bSaveAndValidate; \
nCtlID;
#define DDX_TEXT(nID, var) \
if(nCtlID == (UINT)-1 || nCtlID == nID) \
{ \
if(!DDX_Text(nID, var, sizeof(var), bSaveAndValidate)) \
return FALSE; \
}
|
|
|
|
|
Returning FALSE from a DDX method means that the data exchange method failed such that the rest of the data exchange process should be cancelled.
You need to return TRUE from your DDX_CBString method unless (for example) validation of the item fails.
|
|
|
|
|
please tell me how to crack maya
I don't know how to tell you but I like IT and Designingas well as Graphic
|
|
|
|
|
sonarat wrote: please tell me how to crack maya
I'd try a hammer first of all, see if that helps.
|
|
|
|
|
I have created a ATL Project in-pro DLL with all default settings. As usual,i
added a Control ATL Object to the app, and then tried to add a Proptery ,say "name" ,using "Add Propery Wizard" to the interface created with the project. my confusion is why the Wizard only modifyes the idl file,and no corresponding code added to the implementation class, i expected the Wizard would add the methods get_name() and put_name() for me. yet .net2005 didn't. I realy dont' know how to make it work as i expected.
Thanks in advance.
|
|
|
|
|
hi guys ;
I have problem when i do my porject and I can fugier it out , i made a program can read any list of interger number and stor it in vector and do statestic clculatiom like: Statistical median , Arithmetic mean ,Variance,Standard deviation,Frequency distribution,Histogram,Mode , and i made it only Statistical median , Arithmetic mean ,Variance,Standard deviation equation but dosn't run Variance,Standard deviation have error. and i don't want to used the majce number to vector becauses it case me problem i will post the code if somone please help
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
//decalre constant to control the size of vector
int const SIZE =1;
unsigned number ;
unsigned *pointerNumber= &number;
unsigned Arithmetic_mean;
/*double variance=0;
double deviation;*/
//declare vector avariable to store the list of number
vector <unsigned> listNumber(SIZE);
//declare iterator and used it to find max and minin the vector and for Statistical median
vector <unsigned>::iterator max_listNumber_Iter,min_listNumber_Iter;
cout<<"Enter the stream number to stop EOF"<<endl;
for="" loop="" to="" enter="" the="" vector="" element=""
="" for(unsigned="" i="0" ;="" i<="" listnumber.size()="" ;i++)
="" {
="" cin="">>number;
if (cin.eof())
break ;
listNumber.push_back(number);
}
//find the max and min ot the point and m
max_listNumber_Iter = max_element ( listNumber.begin ( ) , listNumber.end ( ) );
min_listNumber_Iter = min_element ( listNumber.begin ( ) , listNumber.end ( ) );
//show the max and the Min fo the vector
cout<<"Maximum number ="<<*max_listNumber_Iter<
|
|
|
|
|
Sorry that the subject is vague because it's hard to describe my question in one line. I have zero experience with ATL.
I was given this ATL DLL project at work that embeds web browser on our application. I was using #import [browser.dll] to access the methods, and CreateInstance() to create the browser. That's how it was used in the example exe project that used that DLL.
My lead suggested that I should remove #import due to its hard-coded path dependency, and I should just link it using the lib file that DLL generates during compilation. The DLL is guaranteed to reside in the same directory as the main exe, and it'll not be replaced by any other DLL.
What's the best way to fix this problem? But I noticed that lib files don't generated when you compile ATL DLLs (I could be wrong). Can somebody lead me to an example?
Thanks in advance.
|
|
|
|
|
I should add that I could modify this ATL DLL source anyway I want. It just has to work.
|
|
|
|
|
MonkuMonku wrote: My lead suggested that I should remove #import due to its hard-coded path dependency, and I should just link it using the lib file that DLL generates during compilation.
#import has nothing to do with linking. #import generates wrapper classes for COM objects at compile time. COM operates completely at runtime and does not use LIBs to find DLLs.
|
|
|
|
|
Michael Dunn wrote: #import has nothing to do with linking.
Yeah but his "lead" says so... idiom[^]
|
|
|
|
|
As suggested by Michael, the #import generate the wrapper classs for coclasses that are part of ATL dll,
any COM DLL need to be registered before it use, and location of dll is irrelevent as it shourld be registed in the windows registry by using "regsvr32" command.
if you don't want to use the #import you can directly create the instance of class by using CoCreateInstance but life is more tough without #import as you have to handle the AddRef and Release part of your own.
Regards,
Sunil Tonger
|
|
|
|
|
and you are telling me all of that because??
|
|
|
|
|
|
Does this have anything to do with ATL/WTL?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Oh yes.
The first, i think i will create dll with ATL to hook IE message just like BHO. And i have call my process when the URL end with doc,pdf.... It is not true with my ideas. I want my process place inside the IE Browse.
If you have any document talk about it please tell me. Thank.
|
|
|
|
|
I am guessing here and I don't know if it's relevant, but do you think something like this in registry (for your file) helps you
HKEY_CLASSES_ROOT\.txt
where .txt could be any extension. Check registry.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
anyone know url for downloading documentation of tidyatl.dll? I know some urls for it, but they aren't available. Please help me. Thanks
|
|
|
|
|
I have to write the event handler for MSCOMM.OnComm who is listening to serial port for data, so that the event is fired 'OnComm' is executed when the data is arrived.
My understanding for the documentation is unclear as how to achieve this.
Does any one have the sample source code implementation in C# / C++?
Thanks and Regards.
Amar.
|
|
|
|
|
Search MSDN for the VCTERM sample application. It is a C++ program that uses MSCOMM.
|
|
|
|
|
How to Generate OLE dispatch map functions using class wizard or using any other.
please help.
|
|
|
|
|
I edit a sample program. To exercise container's function. I compiler the program is ok. When run the code "mPacket[uid_] = Finishtime;". Then the memory is error. Why? How to update it? Show my program below(flow.h & flow.cc).
---------------------flow.h------------------------
#ifndef FLOW_H
#define FLOW_H
#include
class flow
{
public:
flow();
~flow();
void addPacket(int uid_, int Finshtime);
std::map<unsigned int,="" int=""> mPacket;
};
void flow::addPacket(int uid_, int Finishtime)
{
mPacket[uid_] = Finishtime;
};
#endif
---------------------flow.cc------------------------
#include "flow.h"
int main()
{
flow *mflow;
mflow->addPacket(1,33);
mflow->addPacket(2,55);
return 0;
}
|
|
|
|
|
In your main() function :
int main()
{
flow *mflow;
mflow->addPacket(1,33);
mflow->addPacket(2,55);
return 0;
}
Have you forgotten to new a flow object ? As in :
flow *mflow = new flow();
- Bio.
|
|
|
|
|
I am creating an activeX control for web use. I want to initialise the control state when it is loaded on the website.
How do I best do this? ( In effect I am trying to do an "OnInitDialog()" kinda thing ).
Hope my message is loud and clear.
bart
|
|
|
|
|
I think that what you want is here..
http://msdn2.microsoft.com/en-us/library/Bb250489.aspx
|
|
|
|