|
I must admit I'm not overly familiar with Access, I only use it to verify my ADO code is working. What data import form, and what do you want it to actually do for you, or do you only want help with the GUI part of it ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I want to get lots data item from a control like Access.
Then I get the info from it to create a TCP msg for sending.
I don't want to use a Database,only to get info with a friendly way.;P
|
|
|
|
|
So you're actually asking a GUI question ? Could you direct me how to find the form you're talking about in Access 2000, so I can see what you want ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I think he prolly means that he has some form elements like text boxes, combos etc.which he wants to fill up using data from a database
or perhaps he wants a DBGrid control
Nish
|
|
|
|
|
Can any one tell me how to write a plug in for Microsoft Outlook and other mail applications in vc?
Ur help will be highly appreciated.
|
|
|
|
|
In VC:
typedef struct tagDataSet{
UINT Row;
UINT Col;
LPCTSTR Tips;
double Data;
} *LPDATASET;
UINT WINAPI GraphToBitmap(LPDATASET lparDataSet[DATASIZE],LPBMPFILE lpFile,LPDATAPARAM lpDataParam,LPGRAPHPARAM lpGraphParam);
In VB:
Private Type LPDATASET
Row As Long
Col As Long
Tips As String
Data As Double
End Type
Private Declare Function GraphToBitmap Lib "XGraph.dll" (fdata As LPDATASET, tfile As LPBMPFILE, tdata As LPDATAPARAM, tchart As LPGRAPHPARAM) As Long
...
If GraphToBitmap(fdata(1), tfile, tdata, tchart) = 0 Then Debug.Print "OK"
...
But at this line error in vc
CString sBuff;
sBuff.Format("%d", lparDataSet[0]->Data);
MessageBox(NULL,sBuff,"",MB_OK);
sBuff.Format("%d", lparDataSet[1]->Data);
MessageBox(NULL,sBuff,"",MB_OK);
How to do?
thanks
\\\|///
\\ - - //
( o o )
+--------------------oOOo-(_)-oOOo--------------+
| |
| URL : http://GhostStudio.yeah.net |
| OICQ : 7420909 email:MornLee@21cn.com |
| CyberGhost |
| Oooo |
+--------------------oooO---( )---------------+
( ) ) /
|
|
|
|
|
I am thinking of various options for the interface to a new program I am starting.
One option I am considering is a Photoshop-like interface, with a toolbar, and various control and param windows, as well as a docking window on the side or something. the difference is that there would be no 'document', just the control windows. The current version of this application simply throws windows around the desktop, and opens new ones on a whim. each window is significantly different.
My understanding of DocView does not lead me to believe it can do such a thing (its more for multiple views of various forms of the same basic types of data). Is there a way to get this to work without resorting to complex hacks?
\\ Rock
|
|
|
|
|
No, with MDI you can define multiple document types as well as multiple views, so you can have significantly different ways of showing the same data, or of showing different data. This is really the strength of the doc/view architecture, the fact you can use one representation of your programs data and link to it with differing ways of showing the contents of the document.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Yes, but what I mean is that I dont need all the functionality of a view. just a simple window. (think the VB IDE without and documents in the main window. just control windows...)
docking controls would work as well, however they would have to have full support for controls and all the good stuff.
\\ Rock
|
|
|
|
|
In that case, I guess you can just create a window and write your own 'views' of the data as you choose to store it. However, your first question seemed to be if MDI could handle what you want, and it can.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Why can't I do a copy'n'paste from the variables window or quickview? I want to copy the value out and paste it somewhere. How did they screw such a simple thing up? Does anyone know of a way to get at that data?
|
|
|
|
|
You can use the watch window.
BTW: come to #CodeProject on DalNet (mIRC)
|
|
|
|
|
Hi,
I want to format a flot into a string rounded to three digits.
I thought the code, should work.
double dtest = 10.329;
char buffer[255];
wsprintf(buffer,"%10.2f",dtest);
MessageBox(buffer);
Cheers
Rich
|
|
|
|
|
wsprintf(buffer,"%.3f",dtest);
will round it to three digits past the decimal point.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Unfortunately, wsprintf (part of Win32 API) doesn't accept %f, %g or %e. sprintf from stdio.h will do the job - it recognizes escape sequences for floating point.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
You can also use the standard library "stringstream" class to format a std::string, like this :
double dTest = 10.329
std::stringstream ss;
ss << setiosflags( ios::fixed ) << setprecision(3) << dTest;
cout << ss.str();
std::stringstream ss;
ss << setiosflags( ios::fixed ) << setprecision(2) << dTest;
cout << ss.str();
std::stringstream ss;
ss << setiosflags( ios::fixed ) << setprecision(1) << dTest;
cout << ss.str();
This looks like more code/work for such a simple example, but often this ends up saving you code if you then have to use the 'string' in other functions.
The standard library stringstream also has the advantage that you can extend it in two ways:
(a) writing your own manipulators (for example, you can write a 'percent' manipulator that converts a value into a percentage as it is written to the output;
(b) you can write inserters/extractors for user defined types, so that you can use the same syntax to write your own types as you do for the 'built in' types like double.
-----------------------
The sermon on the mount...
Man 1 : Hear that? Blessed are the greek.
Man 2 : The greek?
Man 1 : Well apparently, he's going to inherit the earth.
Man 2 : Did anyone catch his name?
|
|
|
|
|
Dear sir,
I met a strange probelm when I am trying to program my first
MFC extended DLl. That is, I need to use STL in my DLL and
I define some date type such as:
typedef CArray<char,char> CStatusArray;
typedef CArray<int,int> CIndexArray;
But When I compile the file, I got
error C2143: syntax error : missing ';' before '<'
error C2143: syntax error : missing ';' before '<'
warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared
I know this is related to the DLL programming itself since the error is not
incurred in my MFC exe project. But I am new to DLL programming. So I am posting this to get your help. Thank you very much and any suggestion is welcome.
Best regards,
Cheng LEI
|
|
|
|
|
You're not using STL, you're using the Microsoft container classes. A CArray needs to have two templated arguments to tell it what to contain ( STL containers need one ). You probably *should* use STL, but that is another story.
The problem is not the typedef, but the fact that you probably have not provided the template arguments either in the typedef or the instances you use your typedefed names. Wthout providing the template arguments in the typedef, I can't see any reason for it myself. I never bother with typedefs at all, but they can make code more readable for people who are not familiar with templates or (in my case) STL.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Dear Christian and Michael,
Thank you for your helpful suggestion. I added #include "afxtempl.h" as
Michael said and there is no more errors. The original errors are not due to STL. Very sorry for this. In fact, there are some parts using STL in my code
such as
struct TrackedFeature {
CvPoint2D32f m_cvPoint;
int m_videoframe_index;
};
typedef std::list<trackedfeature> CvFeaturesList;
typedef CvFeaturesList::iterator CvFeaturesList_It;
I made a mistake to think the error is from STL. I am sorry, STL.
Now, I have another question, maybe caused by my not-so-good programming
skills. That is, I want to make my View and Doc class in a "MFC exe " project as a DLL to be used by other projects. But in the code, I need to get the
point of the "Application" (by AfxGetApp()). Since there are some project-specific memebers to be used in the class of "***App", such as a point to
another view class, it makes me unable to visit such members by just geting
a CWinApp using AfxGetApp(). What I am wondering is how I can get around with this. I think this problem is completely caused by my bad programming way.
But there is no much time left, so I hope no much modification needed.
I don't know if I said my question clearly. Wish to get your further suggestions. Anyway, thank you very much for your help on my last problem
and I will try to solve the new problem myself independently. I should not
always bother others with some maybe too trival questions But it's better
if I could get suggestions from you, the code gurus
Thank you very much again.
Best regards,
Cheng LEI
|
|
|
|
|
Cast the return value of AfxGetApp() to your CWinApp-derived type:
CMyApp* pMyapp = (CMyApp*) AfxGetApp(); A word of caution though, if you rely on this in your DLL, then you must make an MFC regular DLL, not an MFC extension DLL. An extension DLL shares the CWinApp object of the EXE, whereas a regular DLL has its own CWinApp object.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
Dear Sir,
So as you said, in my extension DLL, I should avoid using the App class.
It's realy bad and I will make corresponding modifications. Hope I am luckyenough to finish it in time
By the way, I visited your homepage and found a lot of useful stuff.
You self-introduction hoempage is funny
Thank you again!
Best regards,
Cheng LEI
|
|
|
|
|
hee, thanks Good luck with the project.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
I thought that the OP wanted a pointer to the EXE's CWinApp object? And shouldn't he in that case use an extension DLL for the very same reason?
I must be missing something....
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
He had an EXE and put member variables in the CWinApp-derived object. He wanted to keep that same system when he moved the code into a DLL.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
Ah, I see. I just read that he wanted to move the view and doc classes to a DLL. I kinnda figured that since the frame wasn't moved into the DLL then the data should stay in the EXE CWinApp. But I missed the "to be used in other projects" part. This would imply that the data in CWinApp belong to the view/doc classes and not to the CWinApp. So shouldn't it be put in either DLL static data storage or in document members?
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|