|
markjmalin wrote: to be able to take any container window and put whatever controls I want in it
CAxWindow already does that so I am completely confused at this point.
led mike
|
|
|
|
|
Hm.... I need to look at our design. The guy who did the design is no longer here. One thing we've done is create our own private heap class. It's very likely he wrapped this code to make use of our own New and Delete methods in our private heap.
So you're saying a guy could have a vector of any number of CAxWindow's and be good to go?
(sorry for the ignorance -- I'm not all that adept at ActiveX and COM)
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
markjmalin wrote: So you're saying a guy could have a vector of any number of CAxWindow's and be good to go?
Well not yet since you still did not explain "why" you need anything in a vector. So far all you mentioned was the painting routines which are already managed from a calling stand point so there would be no need for you to access any of these objects at runtime in association with painting.
led mike
|
|
|
|
|
Sorry. The ActiveX controls have methods that need to be called on them. Obviously things like painting happen already. These controls are things like real-time graphs (strip charts) for instance, which have data sent to them, status information, etc. There are numeric displays that a user might interact with via touch-screen, which might visibly change based on user input. We're using a "Model/View/Controler" pattern, and the "View" part of that will contain the ActiveX controls for user input and display of information. The Model and Controller (also COM objects) process user input events from the View and change the display of the ActiveX controls where needed.
So I need some way for the Model to manage the View. Since the View is a container of ActiveX controls, the Model needs access to these to update them and make visual changes via calling methods on them. If a View container can have any number of diverse ActiveX control on it, I thought a vector would be a good route.
Our current design has specific View containers pre-defined. It's a very non-flexible design. One pre-defined view might always have 3 buttons along the top, so there are 3 "ViewHost" members containing buttons. It may always have a static text box, so there's one "ViewHost" member for that. When the user touches the button, maybe the next step is for the other two buttons to dissapear and the text to change. The Model needs to have access to the View's ActiveX controls to tell the 2 buttons to make themselves invisible, and push some text into the text box.
Hope that makes it clearer.
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
markjmalin wrote: the Model needs access to these to update them and make visual changes via calling methods on them.
MVC pattern should utilize "events" to notify listeners of data changes. Then listeners "pull" data. This way the Model remains isolated from knowing about Controllers or Views. This is a major factor in the MVC design.
In your case it sounds like your View windows (the containers of all the CAxWindows) might be good candidates for registering for the data events. Then each View would have the logic about how to call methods in all it's child windows to update their displays.
Does that help?
led mike
|
|
|
|
|
That helps a great deal. Thanks!
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
I'm working on a data processing application where the user selects the data source and relevant fields at runtime. No matter what the source (Access, Excel, MySQL, etc) I am able to retrieve the table names and column information. But for any non-access data source, when I query it, there are no rows returned and the application crashes on my MoveFirst call. Here is the source, and forgive me, this is my first time with ATL:
<br />
CDataSource source;<br />
CSession sess;<br />
<br />
CTable<CDynamicAccessor> rs;<br />
<br />
USES_CONVERSION;<br />
<br />
if(source.OpenFromInitializationString(A2OLE(m_lpFilename))!=S_OK)<br />
return FALSE;<br />
<br />
<br />
if(sess.Open(source)!=S_OK)<br />
{<br />
sess.Close();<br />
source.Close();<br />
<br />
return FALSE;<br />
}<br />
<br />
<br />
CString sSQL="..."<br />
<br />
<br />
rs.Open(sess,sSQL);<br />
<br />
HRESULT hr=rs.MoveFirst();<br />
The debugger asserts on the rowset being NULL, so I take it nothing was returned from the data source but queries run against the database (like in the MySQL console) return rows.
Any idea at all whats going wrong?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
CTable doesn't accept an SQL-string as argument, it expects a table name. It could be the case that CTable crashes due to poor error handling. Have you tried with CCommand?
--
LOADING...
|
|
|
|
|
You're right, its not supposed to accept SQL. Very odd that it would in certain cases. Now that I've addressed that, everything is working great. Thanks!
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I want to add Atl New Object to my project And according to theory it sould be present in Insert Menu But that is not present in my vc++6.0 Enter price Edition...
Can anybody help me how to get it
|
|
|
|
|
does answer in VC++ forum doesn't satisfy you?
|
|
|
|
|
hy.
I am write aplication in WinXP on DCOM and i have a lot of problems with it.
My question is : meybe there is samthing else that better that DCOM or samthing that replace DCOM or may be .NET have anything else.
I tred to find any books on DCOM but I can`t find any new books on DCOM. a books that a found them from 1999 and there is nothing on DCOM in WinXP.
please help me.
thanks.
greg
-- modified at 4:42 Sunday 22nd October, 2006
|
|
|
|
|
i recently coded an Empty Hello Projcet using VC6.0.
this project consists of three files:
1 MySimple.cpp
//----------------------------------------
#include "accum3.h"
#include <iostream>
template< typename T >
inline
typename AccumulationTraits< T >::AccT accum(T const* beg, T const* end)
{
return Accum< T >::accum(beg, end);
}
int main()
{
int num[] = {1,2,3,4,5};
accum(&num[0], &num[5]);
return 0;
}
//------------------------------
2 accumtriats.hpp
//-----------------------------
template< typename T >
class AccumulationTraits;
template<>
class AccumulationTraits< char >
{
public:
typedef int AccT;
static AccT zero()
{
return 0;
}
};
template<>
class AccumulationTraits< int >
{
public:
typedef long AccT;
static AccT zero()
{
return 0;
}
};
......
//--------------------------------
3 accum3.hpp
//----------------------------------
#include "accumtraits2.h"
template < typename T ,
typename AT = AccumulationTriats< T > >
class Accum
{
public:
static typename AT::AccT accum(T const* beg, T const* end )
{
typename AT::AccT total = AT::zero();
while( beg != end )
{
total += *beg;
++beg;
}
return total;
}
};
//------------------------
but when i try to complie this project, problems start to arise like fellowing:
"AccT" is not a member of AccumulationTraits
being stuck by this problem for days, i really get
frustrated. Doesn't VC6.0 surpport syntax like this?
template< typename T >
class AccumulationTraits;
template<>
class AccumulationTraits< char >
{
public:
typedef int AccT;
static AccT zero()
{
return 0;
}
};
well, i am all at the sea now
i do define AccT in AccumulationTraits
|
|
|
|
|
I suggest you to post your code in proper format , using pre tags.
|
|
|
|
|
Hello Yaki_15,
Visual C++ 6.0 is not fully STL compliant. VC++ 7.0 -is-.
I compiled your code in VC++ 7.0 with no problems but faced the exact same compilation error that you faced when I did it with VC++ 6.0.
However, I came up with a workaround for you :
try adding this class :
template < typename T >
class return_value
{
public:
typedef AccumulationTraits<t> traits_type;
typedef traits_type::AccT type;
};
then re-declare "accum" as follows :
template< typename T >
inline typename return_value< T >::type accum(T const* beg, T const* end)
{
return Accum< T >::accum(beg, end);
}
The compilation worked this time. The results are the same when I used "accum()" in main().
Best Regards,
Bio.
|
|
|
|
|
Hi, Bio
<I compiled your code in VC++ 7.0 with no problems >
After days' searching for stuff on this, i begin to know that VC++7.0
Surports:
Partial Specialization of class templates
but VC++6.0 doesn't, as well as follow Advanced Features of C++:
1 Out-of-class member template definitions
2 template template parameters
It's said that VC++7.1 or higher is upto 98% conforming to the C++ Standar,so
the featurs we discuss above are well surpported by VC7.1
<try adding this class>
where should i place this class? i need more information like this:
1 in which file
2 at which position(a Forward Declaration?)
I really appreciate your work and help.
best wishes
Yaki
|
|
|
|
|
Hello Yaki_15,
Yes, the issue is that VC++ 6.0 is not fully "Standard C++"-compliant, and not that it is not fully "STL"-compliant. I was wrong there. Thanks for showing me the right info
Best Regards,
Bio.
|
|
|
|
|
<try adding this class>
class return_value
{
public:
typedef AccumulationTraits traits_type;
typedef traits_type::AccT type;
};
I changed your class like this:
class return_value
{
public:
typedef AccumulationTraits< T > traits_type;
typedef traits_type::AccT type;
};
and placed it at the end of file accumulationtrait.hpp
and the program can be complied with no error and run well.
|
|
|
|
|
Hello Yaki_15,
Congratulations on resolving your problem. Strange thing is that I did declare the "traits_type" typedef in "return_value" class as "AccumulationTraits< T >". The "< T >" somehow disappeared when I posted my message.
It's good anyway to see that your code is now working well
Best Regards,
Bio.
|
|
|
|
|
Hi all,
Respected Members,
I want to upload pd's and mp3 files using .net 2003, if any one have idea plz mail to me
My email id: vijayprakash.g@gmail.com
thank you.
Vijayprakash.g
vijayprakash.g
|
|
|
|
|
|
I am a newbie.
I need print a kind of bill , which content some title word and a table . I use a listviewctrl as the container including data.
hte following work is printing them to a bill with their precise position. I can not write the code of printint data with my wtl programme.
how to?
|
|
|
|
|
Scenario:
Using a dll with javascript. The DLL resides in the server, and gets
downloaded into the client's machine as I specify the codebase= in the <OBJECT> tag of the HTML page.
Question:
How do I change the Classid of my component? The problem is that when I make a new version of the component, The client machine doesn't recogonise it as new(as the classid is remains the same as the older one) and hence it doesn't download the
new copy of the dll. So no matter what changes I make in my component, the client machine continues to use the older version of the dll that it downloaded long time ago until I mannually remove it from downloaded programs. Please help.
|
|
|
|
|
Use the #Version=a,b,c,d fragment identifier on the CODEBASE attribute documented here[^] to have the browser download a newer version of the component. You can keep the CLSID the same.
If your new version of the component is not compatible with the older version, you should change the CLSID.
|
|
|
|
|
breakthrough .
|
|
|
|