|
I do not believe Windows SDK provides any database connection functionality. You will have to use the ODBC SDK at minimum or native drivers/tools provided by the DBMS vendor or newer connectivity tools likes ADO, OLE DB etc. I am assuming when you said SDK you meant Windows SDK.
|
|
|
|
|
Hi,
If you use Access, you can use CDao* classes.
hope it helps !
|
|
|
|
|
After having used CListCtrl::FindItem() to find the index of an item I want to mark the row with that index how do I do that?
I also committed the crime of posting a programming question in the Lounge.
|
|
|
|
|
To select item number i in list control use:
m_list_ctrl.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED);
To ensure that item number i is visible, use:
m_list_ctrl.EnsureVisible(i, FALSE);
If you want full row selection in list control:
m_list_ctrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT );
|
|
|
|
|
Mark?
If you by "mark" mean "select" then use the SetCurSel(index) method
|
|
|
|
|
Argh! Ignore my previous post, too early in the morning...
|
|
|
|
|
Hi
Can someone explain PeekAndPump() function and why should we use it with a ProgressBar??
Is there a standard definition for this function???
![Blush | :O](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_redface.gif)
|
|
|
|
|
Good link http://www.codeguru.com/controls/progress_wnd.shtml
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
The PeekAndPump function you're referring to is probably part of some example. There's no API or MFC function with this name.
Name of this function suggests that there's a loop inside which checks for messages with PeekMessage - hence the 'peek' part. If there's any message, it's dispatched to appropriate window; this is the reason for 'pump'. The peek'n'pump solution is needed because there's some activity going on and progress bar shows the progress of operation.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I am new to programming. I have been given the task of making an application that recieves commands via the serial port. and then displays a notification that the commands were recieved. I have been told that I need to use a thread to do this. I'm not sure where the thread goes, I.E does it go in the source file or the header file? Or do I declare it in the header file and then put the functionality in the OnInitialDialog function?
Thank you for any help.
Mavrock
|
|
|
|
|
Mavrock,
I have done something similar but nowhere near doing an article yet.
Basically:
1. Create a dialogue box
2. Insert the Mircosoft communications ActiveX component into it.
3. Create a variable name for the ActiveX component. This then creates a class for the MSCOMM component (prompt displayed).
4. Set the RThreshold property to 1. This causes an OnCommEvent for every character received.
5. In the OnCommEvent() procedure, event 2 is for soemthing received.
If you want a small sample project let me have your email address and I'll forward it.
I have used this on Win98 and NT4 with no problems.
Elaine (fluffy tigress emoticon)
Would you like to meet my teddy bear ?
|
|
|
|
|
Dear Elaine,
Thank you for the direction. If you don't mind I would really like to see your sample project. You can send it to me at stonematthies@hotmail.com.
thanks. Mavrock
|
|
|
|
|
On this site codeproject.com and on codeguru.com, you can find many articles about your topic
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
Hi there,
I just wanted to add new records to end of record list like this:
Gen
Brus Lee
Arnold
Hadi
and etc.
I wrote it:
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
But when i run this code, the result is strange ...
the result is it:
Hadi
Arnold
Brus Lee
Gen
vice versa ???
But why ?
What's my wrong ?
Help me please !
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
why don't you ask this on Carlos's article ?
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Hello dear Chris,
I sent several mail to him before this, but unfortunatly he didn't answer to mails ...
But what do you think about my problem ? what's wrong ?
Thank you for reply
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi, It's 3 AM in Argentina... I will see that you say in the morning...
In a couple of Hours i need to
I don't know what happens but I didn't recive all the message. I saw your question here but I didn't recibe this question...
I make a question for you.
You tried with the following?
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.Update();
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello my frieeeeeeeeeeeeeeeend
nice to see you
You wroking hard
ok, about the question ...
No, i'll try this way and tell you the result ...
But what is the problem in my pervious code ??
i mean:
m_rs.AddNew();
m_rs.SetFieldValue("NAME", "Gen");
m_rs.SetFieldValue("NAME", "Brus Lee");
m_rs.SetFieldValue("NAME", "Arnold");
m_rs.SetFieldValue("NAME", "Hadi");
m_rs.Update();
But, let me test your way ...
Thanks
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello again Mr.Carlos,
If i tell you what was the problem you'll kill me
I did a kiddy wrong,
my wrong was for index on the field ...
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Anyway, when you insert records in a DB, you should not rely on the insertion order to retreive the data later.
|
|
|
|
|
I suspected That...
I Don't want to start an international conflict, is for that you will live...
It's obvious that if you see the records in diferent order, is by a Index cause.....
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
How can I make a property of a COM to be the default property, say in Field object, it has get_Item(VARIANT *pval). I want in VB client, it can be accesses as MyObj.Field = "hello" instead of MyObj.Field.Item = "hello".
|
|
|
|
|
Give it an id of DISPID_VALUE (that's 0) in the IDL :
[propget, helpstring("property Item"), id(DISPID_VALUE)] HRESULT Item([out, retval] BSTR *pVal);
[propput, helpstring("property Item"), id(DISPID_VALUE)] HRESULT Item([in] BSTR newVal);
HTH
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi.
I am learning DLL creation and implemention from Programming Applications for Microsoft Windows by Jeffrey Richter. Richter demonstrations are straightforward and appear simple. However, I cannot implement a working at all using Visual C++ .NET.
I tried using the DLL Wizard and hardcoding a .cpp and .h file. Neither method worked. I would like to create a simple dll with functions I can use in any C++ programs I work on including MFC. In fact, all my Windows program are MFC. Here is an example of the code.
-----
// myDLL.h
#ifndef myDLL
#define myDLL extern "C" __declspec(dllimport)
#endif
class myDLL MyClass
{
MyClass();
void FunctionOne();
int FunctionTwo();
~MyClass();
-----
-----
// myDLL.cpp
#define myDLL extern "C" __declspect(dllexport)
#include "stdafx.h"
#include "myDLL.h"
MyClass::MyClass()
{
}
...
-----
The code above uses the exact sample algorithm Richter presents in his book. It is does not work. I would like a good solid working example of creating a dll that works in both MFC and non-MFC Windows programs.
Thanks,
Kuphryn
|
|
|
|
|
Try this:
1. open a new 'MFC AppWizzard (dll)', choose project name. >>> NEXT
2. Choose 'MFC Extension DLL (using shared MFC DLL)'. >>> FINISH
3. Add to project your classes ('*.h' + '*.cpp').
4. Add AFX_CLASS_EXT macro before your class name definition:
class AFX_EXT_CLASS CYourClass
{
public:
void Method1();
};
5. After compiling a Release version, Pick out of the 'Release' folder
2 files: 'YourDLL.dll' + 'YourDLL.lib'.
6. In the project you wish to use'em, paste in its dir both of'em, and add
to the project 'YourDLL.lib' + 'YourClass.h' (with AFX_EXT_CLASS)
7. Compile and pray...
8. Please reply if this works well.
9. Succsess....
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|