|
In that case,why does it not take a _variant_t value.
Cause when i try to change the _bstr_t sqlQuery(...) to _variant_t sqlQuery(...) and then pass it to the Recordset->Open(...)function it gives a compile error : error C2664: 'Open' : cannot convert parameter 1 from 'class _variant_t' to 'class _bstr_t'
Why is that so ??
|
|
|
|
|
Are you sure this error is on that same line?
Is this the call for an ADO recordset?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
i think even u would get this error if u try it in ur program.I have checkd it its the same line that gives an error.
|
|
|
|
|
vital_parsley2000 wrote: Cause when i try to change the _bstr_t sqlQuery(...) to _variant_t sqlQuery(...) and then pass it to the Recordset->Open(...)function it gives a compile error : error C2664: 'Open' : cannot convert parameter 1 from 'class _variant_t' to 'class _bstr_t'
It shouldn't. Could you please post the relevant code (i.e. recordset declaration, ecc..)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Interesting - when I try an equivalent bit of code:
#import "libid:B691E011-1797-432E-907A-4D8C69339129" no_namespace rename("EOF", "adoEOF")
_RecordsetPtr rs;
rs.CreateInstance(__uuidof(Recordset21));
_variant_t connstr("Data Source= LibDB;"";,"";");
_variant_t sqlQuery("SELECT * FROM lib_book_details ORDER BY ISBN");
rs->Open(sqlQuery, connstr, adOpenDynamic, adLockOptimistic, adCmdText);
it compiles successfully with VS2008. I would use Visual Studio's 'Go To Declaration' feature (right-click on Open) to see how your Open method is declared.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All
How can i read List control CString values?Plz help me
|
|
|
|
|
CListCtrl::GetItemText[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Vietnam I
The level of the average programmer.
Sorry, because I asked many questions.
Assembler too difficult, I do not know it.
I see the bochs-2.4-msvc-src but I do not know.
Please, help me Who wrote the CMOS Boot from USB to 1
Partition of the HDD is divided into 4 Partition.Using
memory: 510K.
Boot-> create 1 window with Style, interface (GUI) by
my style + 1 ImageButton with event: Shutdown
computer.On window that displays mouse position.
All use VC6.Please, sourcecode no book
Vietnam
Thank you very much!
Vietnam is very beautiful country to invite me.
|
|
|
|
|
I am building my application with the standard PNG shared
library , libpng.so.
But at the time of linking it is giving me undefined references error pertaining to
some symbols.
When I checked the object file(libpng.so) with the "nm" command
I saw that these variables were local variables of the library.
I want to know if there is any linking option that I can use
to be able to access them during the linking ?
|
|
|
|
|
If my understanding is correct 'local' means 'not exported', i.e. 'private'. Why do you want to gain access to private symbols?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm working on a pizza store in VS 2005. I set up the design and member variables correctly(I think). I have no idea how to work on the coding now. I have radio buttons for the size of the pizza and check boxes for the toppings. I also have edit boxes for the name, address, and phone number. Also, I should add a calculate button. How would you set up a member variable for a button? When I click the button I want it to display in the summary edit box the person's info first, then the size and toppings(along with their prices) and then the total price. Can anyone help? Does anyone maybe know of any free tutorials on dialog-based stores?
|
|
|
|
|
Ryuk1990 wrote: How would you set up a member variable for a button?
For check-boxes, right-click on the control and select 'Add variable' in the context menu. Make sure the 'Control variable' box is unchecked.
The procedure for radio buttons is slightly different - see the MSDN page[^].
It seems you now have to add DDX_whatever calls into your dialog's DoDataExchange method for value variables (which is a pain in the behind - I though Visual Studio did it for you), so here are some examples:
DDX_Check(pDX, IDC_CHECK1, c1);
DDX_Radio(pDX, IDC_RADIO1, values);
DDX_Text(pDX, IDC_EDIT1, edit);
DDX_Text(pDX, IDC_RICHEDIT21, rich);
Now, for the calculate button - for buttons like that, you add an 'OnClicked' method. The easiest way to do that is to double-click on the button in the MFC dialog editor - Visual Studio will add the handler automatically.
In the handler, the first thing to do is to call UpdateData(TRUE), to get the values of controls into your member variables. Now you can calculate a string holding your summary information, assign to to the string variable associated with your edit box and finally call UpdateData(FALSE) to push the string value into the member variable values into the controls:
void CMyDialog::OnBnClickedCalculate()
{
UpdateData(TRUE);
m_summaryValue = m_firstName + " " + m_secondName + ", " + m_address + whatever else you want;
UpdateData(FALSE);
}
Hope that helps!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'll look into that, thanks.
By the way, do you know how to delete previous member variables that I created? I don't think I set up my MV's for check boxes correctly.
|
|
|
|
|
Ryuk1990 wrote: By the way, do you know how to delete previous member variables that I created?
Remove their declarations and all references to them from the dialog's .cpp and .h files with the text editor. The 'Find All References' command (right-click on the variable in the text-editor) is useful for that (if you can't see that menu command, it's possible it's VS2008 only - I don't have VS2005 installed).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Ryuk1990 wrote: Can anyone help? Does anyone maybe know of any free tutorials on dialog-based stores?
what about 'Scribble'. It's free with the Compiler.
Bram van Kampen
|
|
|
|
|
Any ideas how I could implement something like this:
void a_main() { ; }
#define b(fn) a##fn()
int main()
{
b(__FUNCTION__);
return 0;
} Hope you get the idea, since I'm not good at explaining. Anyway, the point is to have the preprocessor to generate the function name for you, or something similar.
Thanks!
EDIT: Oh yeh, obliviously this doesn't work, because preprosessor isn't processing __FUNCTION__ to a umm.. usable text, instead the preprosessor will process it later to a string.
|
|
|
|
|
As you've found, you can't use __FUNCTION__, as it's inserted as a string, not a token. This is a shame, because you can convert a token to a string in the pre-processor, but not vice-versa.
So, you're only option would be this:
void a_main() { ; }
#define b(fn) a##fn()
int main()
{
b(main);
return 0;
}
i.e. putting the function name in explicitly
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yeps, that's how I'm doing it ATM. I just thought that I'd ask if anyone knew a trick I don't. Many thanks!
|
|
|
|
|
Scenario: The application has 10 nodes connected in a network. each node can either act as server/client. At any given time there will be only one server and one client.
My question is say for example if default server is down - then client application will poll the message to remaining nodes looking for server if not it will become server for remaining clients.
So, how to poll message in a network using MFC.
|
|
|
|
|
You can use UDP broadcasting technique in that situation.
Server should implements workerthread which calls UDP recvfrom and client calls UDP sendto when its default server is down.
Notice; UDP broadcasting would not pass through the routers to different network, so machine nodes should be in the same network usually.
|
|
|
|
|
|
How to connect database.database is in exelsheet.
|
|
|
|
|
So which is it: reading from a database or an Excel file? You can use ODBC for both.
You can also use Excel Automation for the latter.
Are you using MFC?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am using MFC. hw to connect exelsheet as database while doing MFC project.
|
|
|
|
|
Supriyanka wrote: hw to connect exelsheet as database while doing MFC project.
Have you tried ODBC with CRecordset and CDatabase ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|