|
Solved it!
I changed
m_cListCtrl->SortItems(SortFunction, (LPARAM)(m_cListCtrl));
into
ListView_SortItemsEx(GetSafeHwnd(), SortFunction, (LPARAM) this);
But why doesn't the m_cListCtrl->SortItems doesn't work
Wim
|
|
|
|
|
Two problems. First, change
SortItems ( SortFunction, (LPARAM) m_cListCtrl ) to
SortItems ( SortFunction, (LPARAM) &m_cListCtrl )
Second, you are thinking lParam1 and lParam2 are the item indexes, but they are not, they are the lParam data associated with the two items being compared. They are always 0 because you probably don't use those data members.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|
|
hi!
how can i use a c# (.net) control in mfc? is this possible?
|
|
|
|
|
Okay, I also made another version of my program... Unfortunatly it won't compile and it gives me this wierd error:
LINK : fatal error LNK1104: cannot open file "nafxcwd.lib"
I don't know why... Anyways, Im betting its because the lib file isn't linked again btu hey Ive nver seen it before...
Any help would be appreciated.
orcblood
|
|
|
|
|
Oh I should say that I made it with C++ and not MFC!
orcblood
|
|
|
|
|
I have seen those types of errors before - you need to check out your project settings.
Make sure all projects and .libs you include in your project have the same setting in the C++ tab under "Code Generation" - they should all be "Multithreaded Debug" for debug mode, or "Multithreaded Release" for release mode. You could ahve them all "Single threaded" too. You can't mix debug and release, nor should you mix single and mulitithreaded.
Give that a go and see what happens. Also, try the obvious, do a "Clean" and then rebuild it.
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
Okay, I made a simple MFC app that just opens and closes dialogs and all that . However I have one small problem. I send it to someone else's comp and it gives them an error:
A required .DLL file, MFC42D.DLL, was not found
Anyone know why this is? Do I have to dig up this dll out of the MSVC++ folder and send it along with the program? Ive tried it on 3 different comps and eachone gives me the same error... Does anyone know how to fix this?
Thanks, Ive never made a program with MFC before so maybe this is why its not working.
orcblood
|
|
|
|
|
You are distributing the debug version of your app. Rebuild it as "MFC Release" and re-distribute it.
Frank
|
|
|
|
|
How do I do that? Lol Im a newbie at it .
orcblood
|
|
|
|
|
Build Menu -> Set Active Configuration -> Click Win32 Release -> ok -> rebuild All.
Frank
|
|
|
|
|
The easiest thing to do is to go to the Project menu and select Settings.... Then go to the General tab and select the Use MFC in a Static Library option.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
It only has Use MFC in a Shared DLL option...
orcblood
|
|
|
|
|
Okay, now it gives me two compiling errors:
AVI PlayerDlg.obj : error LNK2001: unresolved external symbol _MCIWndCreateA
Release/AVI Player.exe : fatal error LNK1120: 1 unresolved externals
Thanks, I know mroe now lol.
orcblood
|
|
|
|
|
You are getting this error because the linker doesnt know where to find the symbol _MCIWndCreateA.
MSDN documentation says that MCIWndCreate function links to vfw32.lib. Try putting that in your linker options as a required library.
Project -> Settings -> Select "Settings for: All Configurations" -> Link Tab
Put "vfw32.lib" in the box for "object library modules". Then rebuild.
Frank
|
|
|
|
|
Oh thank you soo much guys! It works now woohoo! It also works on other people's comps .
orcblood
|
|
|
|
|
orcblood wrote:
It only has Use MFC in a Shared DLL option...
You have the learning edition of VC (or whatever it's called, I forget the exact name) which doesn't let you link statically with MFC. But as you've found out, most folks have mfc42.dll already, so your release version works.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|
|
I want to add my program.exe as a service in windows 2000. Are there any tutorials for doing this either manually or progrmatically.
any help appreciated
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
|
This is the situation:
My computer connects to the internet through gateway software (Wingate) on another computer that is directly connected to the internet. So there is a client application on my computer and a server application on the server computer.
Now the problem is this, i need to make a sort of firewall, but the thing is i cant use a normal firewall because it would just block out the server and i wouldnt be able to do anything anymore (since the connections are routed via the server). The thing i want to do is to filter all the packets that arrive on my computer before they are passed to applications, and even remove them if possible. I have some ideas on how to start but nothing concrete so i would appreciate some advice.
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
Use WinPcap[^] (Libpcap-based packet capture library for Windows)!
Also Libnet[^] (Libnet is a high-level API (toolkit) allowing the application programmer to construct and inject network packets. It provides a portable and simplified interface for low-level network packet shaping, handling and injection) is suitable.
A. Riazi
|
|
|
|
|
> I mean ,for example ,in the folder of "c:\test"
> there are two files aa.txt and bb.txt .They are
> displayed with the default icon of notebook. If the
> user right click the aa.txt and replaceed the icon
> with a icon file which he like,then the aa.txt file
> display with the icon and the bb.txt display still
> with the default icon of notebook.
> Is it correct ?If so ,I think it's hard and want
> some help.
|
|
|
|
|
I dicide to use ReadFile() rather than fscanf() or fgets() to read a file line by line!
Could anyone tell me again (with an example) how to read, every time i press the same button, a line of a file(something.txt) and then if i press again to read the next line?????? (using ReadFile())
|
|
|
|
|
Dennis L wrote:
I dicide to use ReadFile() rather than fscanf() or fgets() to read a file line by line!
IMHO a bad decision. ReadFile knows nothing about lines, only bytes. Every call to ReadFile goes to the system, forcing context switches for every call, while the std iostream functions perform user-land (in process) buffering.
So not only have you lost the ability to read a text-file line-by-line, you have also made it slower.
For easier and "safer" (in terms of making buffer overflows a thing of the past) access to reading lines from a file, you might want to lookup the C++ function std::getline.
|
|
|
|
|
Thank you for replying me!
I've never used this function before and I don't know how to use it!
By the way the program i'm making is in Win32 API!
How can I use it in here?... Please send an example!!
|
|
|
|
|
Mike Nordell wrote:
Every call to ReadFile goes to the system, forcing context switches for every call, while the std iostream functions perform user-land (in process) buffering.
Everything in the CRT eventually calls APIs to get their job done. fstream , fread() , fgets() et al all boil down to calls to ReadFile() .
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|