|
Hello
I'm not shore on what you want to to but first you hav to make sure on that you can use the bookmark. with function CanBookmark(). To make the bookmark function avalible you must set the CRecordset::useBookmarks option in the dwOptions parameter of the Open member function.
If you are about to update certain fields in the database it is sometimes just as good to launch SQL to the CDatabase object with db.ExecuteSQL(SQL)
Cheers
Henrik
|
|
|
|
|
Hi
i am begginer in Visual C++ and i have a quiestion.
assume that we have an Window. in this Window we have some objects . for example we have 3 ICON in the window. how can i simply Drag one ICON(object) and move it everywhere i want and Drop it.
i don't want to use CImageList because using this Class we can't Drag 2 object altogher and we can Drag 1 image on each Drag-n-Drop operation.
if u want to underStand what i want to do See this Amazing applet :
http://www.seanet.com/users/arsen/avltree.html
in this AMAZING AVL Tree(that uses in DataStructure) u can Simply Drag a Node every where u want and Drop it. u can see that When u Drag a Node all of the Nodes are move altogether.
how can i do that ? Plzzz helpp meeee
Regards
|
|
|
|
|
Hi.
-=Ehsan-de-Burge=- wrote:
i am begginer in Visual C++ and i have a quiestion
How much of a beginner ? Are you experienced with C++ ? If not, you need to forget all this and learn C++ before you worry about this sort of stuff.
-=Ehsan-de-Burge=- wrote:
move it everywhere i want and Drop it.
You need to impiment a window ( to hold the icon ) that knows when it is clicked on and moves itself. Moving is easy, MoveWindow or SetWindowPos will do that.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i learned C++ for 2 years. and i know Object Oriented Programming.
So u mean that i have to impiment a window for each Icon and place icon in it ?? and move this windows in the main Window ?
Sorry it seems that my knowlege is poor in Visual. but i am Guidable.
thanks anyway
|
|
|
|
|
-=Ehsan-de-Burge=- wrote:
i learned C++ for 2 years. and i know Object Oriented Programming.
That's cool then.
-=Ehsan-de-Burge=- wrote:
So u mean that i have to impiment a window for each Icon and place icon in it ??
I'd derive a class from CBitmapButton, it does the image stuff you want already. Then just capture mouse clicks and movement and when the mouse is down, call MoveWindow to move the button by the amount the mouse has moved when it moves.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
_beginthreadex / GetCurrentThreadId / GetCurrentThread
each return handles -- I have a thread object which holds the value returned from _beginthreadex().
Can I use that handle to compare with GetCurrentThreadId()? Will it be the same?
I want to put a method on my thread object that will have special behavior (an assert) when it is called from it's own thread....
The MSDN documentation for GetCurrentThread() and GetCurrentThreadId() are really not that helpful. It sounds like GetCurrentThreadId() is the actual handle, where GetCurrentThread() is not.
Any help out there?
Thanks in advance!
|
|
|
|
|
The documentation for GetCurrentThread and GetCurrentThreadId are very clear. GetCurrentThread returns the thread handle and GetCurrentThreadId return the thread ID. The problem is with _beginthreadex which has a confusing return type. It returns a handle even though it doesn't use the WINAPI HANDLE type.
So, test the _beginthreadex return against GetCurrentThread and you should be set.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
GetCurrentThread():
Return Values
The return value is a pseudo handle for the current thread.
Remarks
A pseudo handle is a special constant that is interpreted as the current thread handle. The calling thread can use this handle to specify itself whenever a thread handle is required.
--------
A pseudo handle? What's that? When they call it something like that, it makes me thing that it's not what it seems.... It would be clearer if it said, it returns "the handle".
It sounds like I have to test it to find out. It's also not clear if a thread calls GetCurrentThread() if it will always return the same value.
|
|
|
|
|
Is there a way to check if 2 handles refer to the same object?
|
|
|
|
|
Peter Weyzen wrote:
A pseudo handle? What's that?
Read the entire remarks section, which explains it quite succinctly. The key being the last paragraph:
"The pseudo handle need not be closed when it is no longer needed. Calling the CloseHandle function with this handle has no effect. If the pseudo handle is duplicated by DuplicateHandle, the duplicate handle must be closed."
Frankly, I've been doing serious multithreaded programming for years and have never used either call.
|
|
|
|
|
I have used GetCurrentThreadId to detect if I am calling a routine from a specific thread. If not, then the call is thunked over to the proper thread.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
[emote]Hangs head in shame[/emote]
Sigh, I missed that. Stupid me.
But the good news is that the last argument of _beginthreadex can be used to return the thread ID of the created thread. Then you can use GetCurrentThreadId and compare against the value returned in the last parameter from _beginthreadex.
Sorry about the mistake. I'll go play in traffic now.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hello,
My app is almost complete.. I went to compile it at level 4 and I get a warning "warning C4706: assignment within conditional expression" Here is the only code in my program that gives me any warnings at level 4.. How could I rewrite the following to get rid of the warning?? (I understand the warning but I am unsure of a way to rewrite the while statement...)
Any help would be greatly appreciated!
CFile fileRead;
if(fileRead.Open(m_strCurrentDir+"clients.ini",CFile::modeRead))
{
char cBuf[1024];
UINT uBytesRead = 0;
while(uBytesRead = fileRead.Read(cBuf, sizeof(cBuf)-1)) <- HERE
{
cBuf[uBytesRead] = NULL;
strBuff += CString(cBuf);
}
fileRead.Close();
}
Thanks!!
Rob
|
|
|
|
|
while((uBytesRead = fileRead.Read(cBuf, sizeof(cBuf)-1)) != 0)
This lets the compiler know you aren't crazy and that "=" is what you wanted.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Great! Thanks.. I figured it would probably be something easy like that
Thanks again,
Rob
|
|
|
|
|
How can I change the background color of my CTabCtrl ?
I have tried to change the brush in the CMyDlg::OnCtlColor function of my dialog, but it doesn't work!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I have found a method!
I have created my own derived CTabCtrl class and overided the OnEraseBkgnd(CDC* pDC) function:
BOOL CMyTabCtrl::OnEraseBkgnd(CDC* pDC)
{
CBrush backBrush(RGB(255, 0, 0));
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect);
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
hey all, just curious if anybody knows how to kill these warnings...
they only show up in my release build, and doesnt stop the program from working...the .exe compiles and runs fine, but still i'd like the release version to compiles 0 errors, 0 warnings before i declare it finished
Deleting intermediate files and output files for project 'cBoogieTest - Win32 Release'.
--------------------Configuration: cBoogieTest - Win32 Release--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
cBoogieTest.cpp
FileInfo.cpp
Generating Code...
Linking...
LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "comdlg32.dll" discarded by /OPT:REF
cBoogieTest.exe - 0 error(s), 3 warning(s)
|
|
|
|
|
|
You can ALWAYS ignore this warning.
You usually can't simply remove the DLLs from your list. They are still needed in the initial link pass and will generate a fatal error if not there.
The solution is to add "/IGNORE:4089" to the "Command Line" link options.
|
|
|
|
|
The linker is saying that you included the import libs for those three DLLs in your link options, however your code does not call anything in those DLLs. It is harmless, but the correct way to remove the warning is to remove those LIBs from the linker options (since they are unneeded anyway).
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
VirtualAlloc allows you to reserve memory pages without committing physical memory. It is useful for writing allocators where the following conditions are met:
- the memory needs to be contiguous OR you must be able to have that memory available
- the maximum size is known in advance
- the maximum size is fairly large
- the minimum size is relatively small
- the growth of the data to the maximum size is not quick or guaranteed (if guaranteed, and you don't want to use the heap, use GlobalAlloc.)
|
|
|
|
|
|
That is about right. VA/VF were never intended for general allocations.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|