|
Hai,
I made a program to input .txt into MS Access.The text file is an output of a math program.Fine.
Now another program retrieves the data and displays it in the list control.Not fine.
The problem is the numbers displayed in the list contains an additional point other than the one already present.
When I checked in the database,it was correct ie same as that in the text file but the point gets added in the list control.Why?Whats the point?
The database fields are strings.
This problem occurs only to certain numbers in random.
I am confused.I need to use this in further calculations but it will harm my other calculations.
Help me.
And this,both the programs DONOT work simultaneously.The first was just a tool to help inputting thousands of numbers from text.
Thanx.
|
|
|
|
|
Hai,
I made a program to input .txt into MS Access.The text file is an output of a math program.Fine.
Now another program retrieves the data and displays it in the list control.Not fine.
The problem is the numbers displayed in the list contains an additional point other than the one already present.
When I checked in the database,it was correct ie same as that in the text file but the point gets added in the list control.Why?Whats the point?
The database fields are strings.
This problem occurs only to certain numbers in random.
I am confused.I need to use this in further calculations but it will harm my other calculations.
Help me.
And this,both the programs DONOT work simultaneously.The first was just a tool to help inputting thousands of numbers from text.
Thanx.
|
|
|
|
|
Hai,
I made a program to input .txt into MS Access.The text file is an output of a math program.Fine.
Now another program retrieves the data and displays it in the list control.Not fine.
The problem is the numbers displayed in the list contains an additional point other than the one already present.
When I checked in the database,it was correct ie same as that in the text file but the point gets added in the list control.Why?Whats the point?
The database fields are strings.
This problem occurs only to certain numbers in random.
I am confused.I need to use this in further calculations but it will harm my other calculations.
Help me.
And this,both the programs DONOT work simultaneously.The first was just a tool to help inputting thousands of numbers from text.
Thanx.
|
|
|
|
|
Hi.
I'm not about to answer your question, but to remind you, that posting the same message under different titles and more than once (I think I counted at least 10) isn't nice style. If you want to correct a message or add something,
reply on your own message thread. And if you did hit 'Submit' more than once, because it seemed like the server hang, delete the message posted additionally.
--------------------------------------------------
"Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software. "
|
|
|
|
|
Hai,
I made a program to input .txt into MS Access.The text file is an output of a math program.Fine.
Now another program retrieves the data and displays it in the list control.Not fine.
The problem is the numbers displayed in the list contains an additional point other than the one already present.
When I checked in the database,it was correct ie same as that in the text file but the point gets added in the list control.Why?Whats the point?
The database fields are strings.
This problem occurs only to certain numbers in random.
I am confused.I need to use this in further calculations but it will harm my other calculations.
Help me.
And this,both the programs DONOT work simultaneously.The first was just a tool to help inputting thousands of numbers from text.
Thanx.
|
|
|
|
|
for my application i need to develop a component which allows the user to select the table,fields inside the table and based on his selection a sql query needs to be build. This is similar to the query builder in ms-access. Is there any component available for the above purpose or is it possible through some com interfaces.Any pointers, references i can get is most welcome.
thanks in advance.
Cheers
kannan
|
|
|
|
|
we built our own that shows as a dialog box with fields specific to the app we develop that allows users to select various groups of items to filter views by and buils a sql statement based on that
i was going to try and generalize it and post it here but i have no time at the moment what with work committments and all but i will get around to it asap
as for any components that i know of ... unfortunately not ... there are some that you have to pay for ... try posting on the database newsgroups for more details
sorry i cant be more help
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
any constructive idea/discussion is warmly welcome!
i love this site!@
|
|
|
|
|
any constructive idea/discussion is warmly welcome
With all technical details you've provided, I have only one constructive idea: use some synchronization mechanism.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hu~,
thanks for ur reply, any way. if u really want to discuss
with me, i should explain the environment in detail.
i m developing a web application service. there are
many front server, being loadbalanced.
i need to maintain a session object between multi server.
the session is generated by server and user use this
session object to request server.
any other idea??
i love this site!@
|
|
|
|
|
Can somebody help how to add Acrobat reader ActiveX control to my dialog.
I installed 5.0. When to to add this control from "Registered ActiveX Controls", an error pops up "Unable to open this ActiveX control. Make sure the control contains a valid type library".
Appreciate any suggestions.
xiang
|
|
|
|
|
The control does not contain enough information for you to reuse it. I'd suggest this is by design.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I've been looking through the examples her at Code Project, but I can't see one that shows me how to create a button or a test edit window entirely in code (i.e. not on the dialog template).
Can someone help me out here ?
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
OK - got that working like this:
RECT rc = {10, 10, 50, 50};
m_btn.Create(m_hWnd, rc, "", WS_CHILD | WS_VISIBLE);
m_btn.ShowWindow(SW_SHOW);
I actually didn't notice that I was creating a button on screen in the corner - why isn't WS_CHILD a default value ?
Anyhow, now I need to know how to get messages from the button in my dialog. From memory it's subclass window, is that right ?
I'm editing this message now - it's not SubclassWindow, which allows me to attach a variable to a control on the dialog. I want to create a CButton and capture it's being pressed ( actually I want to be able to do that to lots of them ). Can anyone suggest how this is done ?\
Editing yet again. I discovered if I overrode WM_COMMAND I could catch the button press, with lParam equalling the hWnd of the button. I've used this prototype:
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
and found that wParam is always 0 and uMsg is 0x0111 ( WM_COMMAND ). Surely WM_COMMAND will be called for things other than buttons ? How can I tell how I got there so I can respond intelligently to the event ?
Thanks
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
I tried to do like you did:
RECT rc = {10, 10, 50, 50};
m_btn.Create(m_hWnd, rc, "", WS_CHILD | WS_VISIBLE);
m_btn.ShowWindow(SW_SHOW);
But I'm using a CView class to display the button, not a CDialog. Is that a problem?
If I want a button to be visible "on" a CView client area, where would I call m_btn.ShowWindow(SW_SHOW)?
Thx,
/Tommy
|
|
|
|
|
I'm not sure how ( or why ) you'd put a button onto a normal CView.
I am actually using the Windows Template Library, but to put buttons onto a CView in MFC, you can use a CFormView, which allows you to set them up using a dialog template.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
|
Um... not quite. There you (very helpfully) showed me how to hook up buttons and so on into a message map. Now I want to create them dynamically, not by putting them on a dialog template and calling SubclassWindow, but by having a vector of controls to which I can dynamically add them, and have the code able to respond to their being pushed. The idea is that we create a set of classes by which people can script the creation of a dialog box and it's controls, so it needs to be ultra flexible.
I've worked out that I can respond to OnCommand, and the lParam ( from memory, the code is at work and I am not ) is the HWND of the control, but none of the other paramters seen to contain anything meaningful. Is this the way to capture buttons I've created on the fly, and if so, does OnCommand respond to anything but controls being pushed ? Either way, when I have a lot of different elements on the dialog, I'm not sure how I'm going to be able to figure out what was interacted with and how, in order to respond to it meaningfully. The Create method didn't seem to take an ID I could assign, for example, and I'm trying not to think about intercepting messages on a dynamically created listview, for example.
Any suggestions you may have on how to deal with a variable number of controls on a dialog that will not be known until runtime will be greatly appreciated.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Ah, gotcha, I see what you're asking now. Here's a snippet that creates a button at runtime. This came from the CP toolbar, actually, and creates an edit box on the toolbar.
m_wndToolbar.GetItemRect ( 1, &rect );
DWORD dwEditStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | ES_AUTOHSCROLL;
DWORD dwEditExStyle = WS_EX_CLIENTEDGE;
HWND hwndEditbox = CreateWindowEx ( dwEditExStyle, _T("EDIT"), _T(""), dwEditStyle,
rect.left+5, rect.top, rect.right - rect.left-10,
rect.bottom - rect.top, m_wndToolbar,
(HMENU) uSearchEditboxID, NULL, 0 );
m_wndSearchEdit.Attach ( hwndEditbox ); This uses member variables for the windows (CContainWindow objects) but this would work equally well for objects you create at runtime.
As for your WM_COMMAND question - lParam is the HWND of the button, HIWORD(wParam) is BN_CLICKED (which is 0), and LOWORD(wParam) is the button control ID. If wParam is coming in as 0, I'd say double-check the control IDs in your CreateWindow() or analogous calls.
--Mike--
http://home.inreach.com/mdunn/
"Make sure that if you are using a blow torch that you don't set anything on fire."
-- Chris Maunder
|
|
|
|
|
Gotcha - thanks for the help.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
There's a main project which consists of many VC & VB components as sub projects . Now I need to build a package which gives me an option to install these components by selecting them from the various options of the components - the installation of one of the componenets need to be in the remote machine. How can i do this???
Pl. suggest me some topics to get an idea on this.
Thanx.
regards
Sankar
|
|
|
|
|
Can someone please point out to me what I am missing.
I have a number of classes (Stored Procedures) derived from a base class (CRecordset). The base class has functionality common to all the derived classes (Open, Execute, Close fuctions), so I am trying to create a function where I can pass the object to operate on as a pointer to the base class, find the derived class from the RTTI and call the appropriate functions.
However my problem is that the compiler sees the void * from the dynamic_cast and complains when I try and call members associated with a void *. I can see why this would be a problem, the compiler has no information on the object pointed to by the void *, after all this is only available at runtime, but is there anyway around this problem?
I wondered if I could use pointers to members to create offsets into the class, but again the compiler complains that the left side of the argument points to a void *.
I believe what I am trying to do can be done, I'm just not sure what I am missing.
Thanks,
Richard
|
|
|
|
|
Correct me if I'm wrong, but could you not use the base class instead of void to declare your pointers?
Ben Burnett
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Here's how to use dynamic_cast. Supposing CMyRecordset is derived from CRecorset.
void somefunc()
{
CMyRecordset objMyRecordset;
CRecordset* pRecordset;
pRecordset = dynamic_cast<CRecordset*>(&objMyRecordset);
if (pRecordset)
{
pRecordset->Open(); //or whatever...
}
}
Good Luck,
Asif
|
|
|
|
|
It's not clear why you're using void * in this context, or, for that matter, why you can't do whatever it is you're trying to do with virtual methods.
dynamic_cast is generally used for up-casting, that is casting something stored in the routine as a pointer to a more generic class to a more specific class (which it must actually be). It should very rarely be needed. You could do something like:
<br />
GeneralClass *p = ......<br />
<br />
SpecificClass *sp = dynamic_class<SpecificClass *>p;<br />
<br />
if(sp) {
...<br />
}<br />
but it's almost always cleaner to do the same thing with virtual methods.
|
|
|
|
|