|
No, I'm not overriding WM_CLOSE, altough I just tried it. I was able to confirm that when I attempt to close the program, it is being called, yet it is not closing my app.
Any suggestions?
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
For a recordset, GetAbsolutePosition works and gives you back the posn of the record. If I want to place myself at record # 3 say, then there doesnt seem to be a corresponding SetAbsolutePosition....?
What can I use?
Thanks,
ns
|
|
|
|
|
A CP class thats not flexible enough for me had the tip in it though. Its weird how one can force an integer to be
pRecordset->PutAbsolutePosition((PositionEnum)3);
even though in msado15.tlh it says:
enum PositionEnum
{
adPosUnknown = -1,
adPosBOF = -2,
adPosEOF = -3
};
I didnt think you could force any old value to belong to the enum when its not even defined in it.
Very puzzled:
|
|
|
|
|
It maybe because of the enum. Well, its positioning me at records that are not anywhere near what I think they should be. INcrementing by one jumps me by several records. Helllppp!
I need to position myself in the set of records referenced by a local index (if 5 were returned, then 0-4 or something...)
Thanks,
ns
|
|
|
|
|
I tried the following which obviously has a flaw:
{
_CommandPtr pCommand;
HRESULT hr = pCommand.CreateInstance (__uuidof (Command));
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Command");
return;
}
pCommand->ActiveConnection = m_pConn;
pCommand->CommandText="SELECT * FROM tblTest ";
_RecordsetPtr pRecordset;
hr = pRecordset.CreateInstance (__uuidof (Recordset));
if (FAILED (hr))
{
AfxMessageBox ("Can't create an instance of Recordset");
return;
}
pRecordset->CursorLocation = adUseClient;
pRecordset->Open ((IDispatch *) pCommand, vtMissing, adOpenStatic,
adLockBatchOptimistic, adCmdUnknown);
CString strContent;
CString numRec;
long num =pRecordset->RecordCount;
numRec.Format("number of records is %d ",num);
AfxMessageBox(numRec);
pRecordset->AddNew();
pRecordset->Fields->GetItem("Color")->Value = "orange";
pRecordset->Fields->GetItem("Texture")->Value = "fuzzy";
pRecordset->UpdateBatch (adAffectAll);
pRecordset->Close ();
}
I feel I'm not telling it where to add. Besides a lot of fields for the record I want to add are not included, just color and texture. ANy clues as to what I need to do to get AddNew to work?
Thanks,
ns
|
|
|
|
|
ns wrote:
pRecordset->UpdateBatch (adAffectAll);
?
Have you tried pRecordset->UpdateBatch (adAffectCurrent);
And which record are you at ?
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
The literature I read said it appends at the end of the rs so you dont have to PutAbsolutePosition(index) to place it at the end. I tried putting it at adEOF but still no results.
Thanks and I will try your suggestion,
ns
|
|
|
|
|
Hey Guys
How do i get global variables available in all files of project. For instance i declare a global variable in a header and then include that header in everything that i want to acces the global variable but that doesn't work so how exactly do i go about doing it so i can have a program wide global accesable from any cpp file.
Peter
|
|
|
|
|
Define the variables above the main () in your main.cpp source. Declare the variables as "extern" in your other header files. Done.
|
|
|
|
|
Cheers Works buetifully
Peter
|
|
|
|
|
I get the error - current recordset dose not support updating. Ths may be due to the lockType. I have a recordset object (from a CP class) and its constructed as
CADORecordset::CADORecordset(CADODatabase* pAdoDatabase)
{
m_pRecordset = NULL;
m_pCmd = NULL;
m_strQuery = _T("");
m_pRecordset.CreateInstance(__uuidof(Recordset));
m_pCmd.CreateInstance(__uuidof(Command));
m_nEditStatus = CADORecordset::dbEditNone;
m_nSearchDirection = CADORecordset::searchForward;
m_pConnection = pAdoDatabase->GetActiveConnection();
}
with
_RecordsetPtr m_pRecordset;
How can I set the lockType and to what should I set it?
Thanks ,
ns
ANother question:
You can see that the search direction above is forward, and each time I search I want to strat from the beginning. How would I accomplish that?
|
|
|
|
|
|
You get it from command line using
nbtstat -A "IP_address"
Thanks,
Satish
|
|
|
|
|
What name do you want?
The "internal" netbios name, like "server", or the dns-name, like "codeproject.com"
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
see documentation for gethostbyaddr() in MSDN. Maybe that'll help.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I tried many source corders, did not find a worked sample for gethostbyaddr().
|
|
|
|
|
what is the fastest way to draw single-color rectangles of equal size (100's of thousands of them maybe!) to the screen... the only thing that changes between them is the color
i thought of these choices:
1) deleting and creating a new brush for every single different color, selecting and unselecting it to the DC, and Rectangle()
2) creating a DIB with one palette entry, then just changing that palette entry for every single color
3) anything else you guys can come up with
thanks,
- Roman -
|
|
|
|
|
FillSolidRect()
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Depends, do you want the screen to be updated constantly as they are drawn? Then #1 is probably the way to go, as it has a decent chance of being accelerated. If you just want them all drawn and then shown at once, using a memory bitmap and an optimized fill routine *might* be faster. But, you'd probably still want to test it.
---
Shog9
If I could sleep forever, I could forget about everything...
|
|
|
|
|
RECT rc;
rc .top = 12;
SetBkColor (hDC, clr);
ExtTextOut (hDC, rc .left, rc .top, ETO_OPAQUE, &rc, _T (""), 0, NULL);
Overall, that is the fastest way to clear a rectangle in GDI (OpenGL, DirectX are different).
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
|
Is it possible to send text to the clipboard without using the context menu/Keyboard shortcut(usually/allways/only the edit ctrls) for 'Copy ' command?
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
Are you talking about by just using any program, or programatically inside of your program?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I want it programatically inside of my program.
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|