|
|
I want the list control header to look flat (like with the LVS_NOSORTHEADER), but I want the OnColumnClick notification. Is there a standard way to do it? Or do I have to subclass and implement drawitem?
I would prefer to have the header control drawn using the default code (I do not want to get involved in the font sizing with different dpi screens and such other details), so, if I subclass the header, can I fire the LVN_COLUMNCLICK myself?
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I think you can trap for left mouse clicks on your list control and then do a hit test on the header control. Then you could launch your sort function within the mouse click rather than the looking for the OnColumnClick notification. Like the following:
CHeaderCtrl* header = m_ListCtrl.GetHeaderCtrl();
if (header)
{
CPoint headerPoint = point;
LV_HITTESTINFO hitTestInfo;
header->ScreenToClient(&headerPoint);
hitTestInfo.pt = headerPoint;
::SendMessage(header->m_hWnd, HDM_HITTEST, 0, (LONG)(HD_HITTESTINFO FAR*)(&hitTestInfo));
if (hitTestInfo.iItem >= 0) // User hit a header column
{
// Do sort routine here
}
}
Ron Ward
|
|
|
|
|
|
Hello,
What's the best way to coding database ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I use VS to edit scripts, but sometimes I write SQL in Notepad.
|
|
|
|
|
Sorry,
I think i've asked the question very bad, in fact i've already database (it's access 2000) ...
I wanna know what's best way to encrypt the data in the database ?
and then use of encrypted data in my program.
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi Rezaee wrote:
best way to encrypt the data in the database
if i would do something like that, i would do something like this:
use the class that is explained here: http://www.codeproject.com/cpp/aes.asp[^]
Every record that is written to de database is first encrypted bij the class.
Hadi Rezaee wrote:
in fact i've already database
for this problem i would put a character at place 1 in your record that says if the record is encrypted yet, if the character is not there the program will know that the record is not encrypted. then ofcourse encrypt the data and put the character before the encrypted data.
this is the way that i would do something like that, i don't know if its the best way.
[]D [] []D []
|
|
|
|
|
How can I get the the network names and there IP adresses?
\Larsson
|
|
|
|
|
Use WNetOpenEnum to obtain the names...
then for each name use gethostbyname to resolve the IP.
Hope this helps
"No matter where you go, there your are..." - Buckaoo Banzi
<pete/>
|
|
|
|
|
Well,
I don't get it to work can you please send me some
code sample?
\Larsson
|
|
|
|
|
im making a game that is rendered by GDI+
however, standard GDI BitBlt's and even threads make the game window look very slow and i can see the refresh rate or whatever you call it when i render to the HDC
my question is... is it possible (and is there an example) of using GDI+ to render to a DirectDraw surface (ill probably use the latest DirectDraw or whatever is easier)
OR (even better)
is there a way for me to draw directly to the screen (without windows layer) like Windows Media Player and DirectX seem to do?
i know it would require some pixel-format conversions but i'm ready to work with that
any suggestions?
- Roman -
|
|
|
|
|
Ok i just got the windows media DRM SDK delivered to me from MS. I added it into my project and now i get a linker error.
error LNK2001: unresolved external symbol __ftol2
I also updated my MS Platform SDK a few dats ago (while i was trying to get a copy of the internet SDK , i didn't even want the upgrade)
I've searched and heard that __ftol2 may have something to do with managed C++ and or .NET , can anyone tell me how to get around this.
thanks.
Jared Allen.
www.chironexsoftware.com
|
|
|
|
|
Seems like the library you're trying to use is targeted at VC++ 7.0: a search on Usenet reveals that __ftol is an internal library of VC++ 7.0's C run-time library.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
_ftol is a function invoked when you do a double to long typecast. it's inserted automatically by the compiler:
; 38 :
; 39 : double t = 100.23;
mov DWORD PTR _t$[ebp], 1374389535 ; 51eb851fH
mov DWORD PTR _t$[ebp+4], 1079578296 ; 40590eb8H
; 40 : int l = t;
fld QWORD PTR _t$[ebp]
call __ftol
mov DWORD PTR _l$[ebp], eax
i'm not sure what _ftol2 is about, but i suspect it's a .Net thing. i see it when i accidentally try to mix VC6 and VC7 .obj files.
-c
Get there first with something patented, proprietary, and broken, then send lawyers after anyone who points out problems. --- Peter Gutmann
|
|
|
|
|
Any idea how to get around it without using VC++ 7.0 ?
The problem is I have a .lib file that references it, and i don't have the source. It's from MS
I've tried to define the function __ftol
long __ftol2(float x) {
return (long)x;
}
But i still get the link problem, i think i'm putting it in the wrong place? put i should be able to have it in any .cpp file of the project?
Jared Allen.
www.chironexsoftware.com
|
|
|
|
|
sorry , i don't know. i always fix it with a rebuild-all, but since i'm not using any libs that i don't have the source to, there's no problem once everything is rebuilt with the same compiler.
-c
Get there first with something patented, proprietary, and broken, then send lawyers after anyone who points out problems. --- Peter Gutmann
|
|
|
|
|
My last attempt at launching a fortran dll with
createThread resulted in the following error.
error LNK2001: unresolved external symbol "unsigned long
__stdcall FTREND3(void *)" (?FTREND3@@YGKPAX@Z)
Debug/cinterface3.exe : fatal error LNK1120: 1 unresolved
externals
I am not sure if the extern and DWORD prototypes are
correct? If I comment out the DWORD function prototype it
compiles and links but does not start the integer function.
Does the createThread actually pass the integer argument of 1 or just start the function and then it sees the shared memory?
Can someone comment? Thanks.
Code below:
#include <stdio.h>
#include <string.h>
#include <windows.h>
struct io {
char time[10];
int start;
};
struct io cio;
/* prototype for function */
DWORD WINAPI FTREND3(LPVOID);
//DWORD WINAPI FTREND3(LPVOID pvoid);
//extern "C" long _stdcall FTREND3 ( long );
// declspec(dllimport) for DLL's
extern "C" __declspec(dllimport) long _stdcall FTREND3 (
long );
void main (void)
{
DWORD tid;
HANDLE hThread;
cio.start = 1;
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)
FTREND3, &cio, 0, &tid);
CloseHandle(hThread);
printf("In c after fortran thread started\n\n");
printf("string = %s\n",cio.time);
}
INTEGER FUNCTION FTREND3 (TIO)
USE DFPORT
IMPLICIT NONE
!DEC$ ATTRIBUTES DLLEXPORT :: FTREND3
TYPE IO
INTEGER START ! if 1 start timer
CHARACTER*10 timeIs
END TYPE IO
TYPE(io):: tio
DO WHILE ( tio%START .EQ. 1)
tio%timeIs = CLOCK ( ) ! Uses DFPORT
tio%timeIs = tio%timeIs // char(0)
write (6,*) 'In fortran after time call'
write (6,*) ' Time = ', tio%timeIs
FTREND3 = 1
ENDDO
FTREND3 = 0
RETURN
END FUNCTION FTREND3
|
|
|
|
|
DWORD WINAPI FTREND3(LPVOID);
extern "C" __declspec(dllimport) long _stdcall FTREND3 ( long ); These two lines shouldn't coexist. Both are function prototypes. Remove the first.
As for the second problem, main is exiting right after the thread has been launched, i.e. it without waiting for it to complete. Try replacing
CloseHandle(hThread); for
CloseHandle(hThread);
WaitForSingleObect(hThread,INFIINTE); Last point is not a question of yours but of mine What do you want to create a thread to call FTREND3 ? You sure you cannot simply call it as a regular C function?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquin,
What is the include file for the 2nd suggestion. I get undeclared for identifiers upin compile with it.
The fortran function is going to be reading alot of data continously and then reducing the data with some large fortran routines already existing. From there it will pass through the C file to a Java GUI for display. There will be option to change the read rate and other calculations that I thought would make this possible with multi threading.
The alternative was to have a thread in the Java GUI continuosly looping and calling the fortran through c wrapper but I thought there were possible time delay issues there.
Let me know if you have any thoughts on this?
Thanks for the help.
Ken
|
|
|
|
|
Hi everybody.
I'm writing a CD PLAYER, (with my own class), using the MCI COMMANDS
with the SendString function.
Everything goes well, but I have two problems.
First: How can I detect when an AudioCD is insert?.
Right now, I have a member function in my class called IsCDInsert()
and with a WM_TIMER message in my dialog, (the method wake up every second),
I can do that, but I think that this is not the right way.
Maybe the question could it be: How can I make my cd player the default player?.
Second: I have, (for example), a slider control in my dialog, and I like to control
the CD Volume with it. How can I link that control with the sistem volume function?.
I have see the MCIWndGetVolume() function, but I dont have a MCI window, and the
function waveOutSetVolume() but I think that it's only for wave files.
Well, thank you very much.
Sorry about my english.
Demian
|
|
|
|
|
"First: How can I detect when an AudioCD is insert?"
Call API function GetVolumeInformation(...). If after call succeeds lpVolumeNameBuffer variable is "Audio CD", CD is insert.
You can read description of this function here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/getvolumeinformation.asp
If you need to know if CD-ROM is present and how many CD-ROMs, call GetDriveType(...) (in case of CD-ROM it returns DRIVE_CDROM).
Sincerely, WiB
|
|
|
|
|
Thank you very much WiB.
Regards from Argentina.
Demian.
|
|
|
|
|
We have an application that is basically just a three-line loop... one is a 1-second sleep, the other two check to see if a process is running and start it if it isn't. We've noticed a lot of page faults in this application. I'm guessing its because the code is being paged out during the sleep, then paged back in when it starts up again. Can anyone suggest how to prevent this?
|
|
|
|
|
Use VirtualLock on the function address. It works only on NT and requires high priveles - usually administrator/system account.
If you only need to see if process died, you can wait on the process handle.
|
|
|
|