|
I would do something different:
1. I would insert all data into CStringArray (into arrays) at the same time that I insert them into the CListCtrl (for viewing into the dialog).
2. I would search through a loop:
<br />
for (int i=0; sizeof(myarray); i++)<br />
{<br />
}<br />
Hope it helped !!
MaestroProgramador.Com
I didn't fail hundred times, I found hundred ways that didn't work.
No fallé cien veces, encontré cien maneras de que no funcionara.
|
|
|
|
|
I have two programs I'm working on: one is based off of the WMSDK DPlay sample, and the other off of the SystemTraySDK sample. The former requires msvcr70.dll, but the latter does not, even after making sure the default libraries are used. Here are the linker options:
<br />
/OUT:".\Release/IGCutter.exe" /INCREMENTAL:NO /NOLOGO /PDB:".\Release/DSPlay.pdb" /SUBSYSTEM:WINDOWS /STACK:2097152,2097152 /OPT:NOREF /OPT:ICF Shlwapi.lib strmiids.lib winmm.lib olepro32.lib ..\..\..\lib\wmvcore.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \Programming\DXSDK\Lib\strmiids.lib \Programming\WMSDK\WMFSDK9\lib\WMVCORE.lib<br />
<br />
/OUT:"..\Release/IGCProcessor.exe" /INCREMENTAL:NO /NOLOGO /PDB:".\Release/TaskbarDemo.pdb" /SUBSYSTEM:WINDOWS odbc32.lib odbccp32.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib<br />
How can I make the DPlay sample-based program not require msvcr70.dll?
Thanks!
|
|
|
|
|
Use a runlime library option that doesn't require DLL. It isn't about the link phase, it is about the compile phase.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks! I discovered that it was using the multi-threaded DLL library, and not the plain multi-threaded library.
|
|
|
|
|
My application can have multiple instances running. If Instance A is on top and a user tries to open a file that is already open in Instance B, I want Instance B to come to become active.
I've come up with various solutions, but am not completely satisifed with them.
Does anyone have a tried and true method of doing this?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
One idea that comes to mind is to use a modified version of CSingleInstance http://www.codeproject.com/cpp/csingleinst.asp[^] and use the memory mapped file to track each instance running. You could also track which files each app has open, then inspect this and active the app which owns the file.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks for your reply.
Variations of this are what I keep coming back to. (I even had such a thing have written when I posted my message, wondering if I was making it too complicated.)
Incidentally, my latest idea is to convert the full path of the file to lower case, calculate an adler32 of it, then create a global event with a suffix of that adler32.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I am currently in the middle of constructing a program that will sort an MS Access Database. It is only a simple application that will read, write, and delete records from multiple tables. There does not need to be a user interface, as that this is being writen to remove and process duplicate records, and will only be used by myself. So far I have started on an MFC application, but the more I learn MFC, the more I realize that it is too much overkill for what I am doing. Does anyone have a suggestion for an alternative that I could write to access an MS access database as an ODBC datasource. Thanks
|
|
|
|
|
how about do it in accesss by writing some SQL statements?
that is the simplest way, no program, it is nothing.
good luck.
|
|
|
|
|
Edward Tompkins wrote:
Does anyone have a suggestion for an alternative that I could write to access an MS access database as an ODBC datasource.
Unfortunately, database programming as you put it is an overkill. Well, when you are a novice. However, for simple reading, writing and deleting all you need is just a few functions, therefore you shouldn't have that many problems. Search for tutorials on database programming and you might find something that is simple. Good luck!
|
|
|
|
|
Well, I'm going to describe what I have and what is the main problem:
I have a ClistCtrl which has ownerdraw progress bars inside it. CListCtrl is FULLROWSELECT and has many columns. (ProgressBars are on the third column for example), and when I click on an Item (text) the full row gets selected, ok for now... but when I click on the progress bar (that is ownerdraw) it works like nothing... it does nothing.
They are different classes and I can get the click on the progressbar class, but when I try a:
<br />
CWnd* pWnd = GetParent();<br />
pWnd->SendMessage(NM_CLICK);<br />
It doesn't work... please help me...
Thanks in advance...
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Send WM_LBUTTONDOWN message instead: but before recalculate cursor position to the client coords of your parent listcontrol and set it in LPARAM...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I tried that too, now I'm trying another thing that seems that is going to work... I have all progress bars on a CMap object, so I get one-by-one its rect with this:
CPoint now;
now.x = GetCurrentMessage()->pt.x;
now.y = GetCurrentMessage()->pt.y;
I calculate with a loop all rects and with this function:
CRect whatever;
bool is_or_not = whatever.isPtRect(now);
If is_or_not is 1, I know that my cursor is on one of the progress bar and through CMap I get its index. Could be that way ??
Thanks in advance.
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Why do you need above?
If you get MouseClick event on your ProgressBar: just convert from client to screen and send(post) the message.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The message sould be sent to the Parent class wich is a CListCtrl type and It works like nothing happened when I call SendMessage from the MouseClick event on ProgressBar... I can't do it.
On ProgressBar mousclick I insert this: (Is a ClistCtrl child)
CWnd* pWnd = GetParent();
pWnd->SendMessage(NM_CLICK);
And on the parent class I insert ON_MESSAGE(.....), but it doesn't work.
Thanks.
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Hi, i try running nmake but it gives me the error "Fatal error: File Win32.mak not found.". I ran vcvars32.bat to add the environment variables but its not changing anything. Anyone know how to fix this?
Kuniva
--------------------------------------------
|
|
|
|
|
Hi,
Please tell me How to add an event handle function in Visual Studio .NET(MFC project).
I add a new button in the toolbar resource, its ID is ID_TEST, I want to handle the click event for this button in CView Class.
please tell me how to do it!!!
Thanks a lot.
|
|
|
|
|
Hi!
Well, on the dialog where you have your toolbar you should add a OnCommand(WPARAM wParam, LPARAM lParam) function and there you should write something like this:
<br />
swith(wParam)<br />
{<br />
case ID_TEST:<br />
{<br />
MessageBox("IT WORKED!!");<br />
}<br />
}<br />
Hope it helped !!!
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Sorry, I typed too fast, please write switch instead of swith. And another more thing: Into your BEGIN_MESSAGE_MAP you have to introduce ON_WM_SYSCOMMAND().
That's all for now !!
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
I know that, do you know how to do it in the IDE(jsut like to deal with the menu item event)?
|
|
|
|
|
There's no way to do it through the IDE, only that way. (And is the best...)
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
I see.
I miss VS 6 so much!!!
|
|
|
|
|
Well, as you can see, if you created your toolbar by code (is the only way)... you also cannot introduce events with IDE... I don0t miss VS6, .NET is the best technology nowadays.
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
I can use classwiard to do that:
Choose a Class name
select right object Id
select command message
That is it.
|
|
|
|
|
Does anybody know what would be an equivalent function to 'GetProcessMemoryInfo' in Unix? I am trying to write a quick feature to check how much memory the processor is using (how much new, malloc, has been called). 'GetProcessMemoryInfo' is what I used in Win2k but I wasn't sure what to use in Unix.. Help..
|
|
|
|