|
Found it =)
The dll loads the following modules: kernel32, msvcrt71.dll, ntdll.dll
I have no use for the msvcrt71.dll. How do I remove it? As far as I know, i use no functions from that lib. This might be the problem.
Ideas anyone?
|
|
|
|
|
Hi All,
I have a very complex dialog with 5 edit controls,4 comboboxes,3 radio buttons and 2 list boxes.
The controls id's are not in sequence(hence i cannot use ON_CONTROL_RANGE).I need to write a handler which will be called whenever user makes any changes to any of the controls.Is there any way to do this without adding an event handler for individual controls.
Thanks in advance,
Raghu
|
|
|
|
|
That is not a complex dialog!
If you want to centralise (create a handler) the control of any change messages, then you write one function that can handle any change and have have all the the change messages rerouted to that handler. What that means is that you have your on-change functions for each control call the same function to handle the message.
On a more practical note; each on-change function should do it's own thing and then call a funcion that, that says "wow, something has changed so we have to update the current status" (display, whatever...) and act accordingly.
Of course you could write a hook, to handle the messages, but that is a more than a bit of overkill for simple message handling.
You could also handle the messages in PreTranslateMessage(...), which is almost the same as writing your code in C (one message handler for the whole window).
Those are the choices I see, but essentualy what you appear to need is just a function that needs to be called it any changed occured. (See "On a more practical note")
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
What is the most common language used for programing mobile games?
dee
|
|
|
|
|
i Think J2ME & BREW
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
J2ME[^]
Brew[^]
Also check out C For Symbian[^] supporting mobile devices
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hi,
I'm not a real windows programming person. I'm doing embedded
systems mostly. I recently wrote some windows app to simulate
my systems. The work was done on Win2K.
The apps use windows event for synchroniztions. On most of the
PCs, the apps run fast. However, on some other PCs, the waiting
for event calls (WaitForMultipleObjects) take so long. All PCs
are Win2K.
I'm trying to look for the cause. Are there some special settings
in Win2K that make the apps slower on some PCs and faster on some
other PCs?
Your inputs will be greatly appreciated.
Thanks,
Tung
|
|
|
|
|
tung salem wrote:
Are there some special settings
in Win2K that make the apps slower on some PCs and faster on some
other PCs?
Well, probably not. It may have to do more with the number of applications they are running (including antivirus, firewalls, etc...) or the speed of there machine (less important now days).
I am a Windows programmer (and firmware programmer) and maybe this will help a little. When you have a piece of firmware code, that is designed to display things etc.., a good choice it to introduce some define statements. That is take the origanal code and add define staments as to what eviroment it is being compiled for. Meaning that, compiled for Windows it will issue Window commands and for firmware it will issue firmware commands (one source code module/file).
A good choice is to create an ActiveX control (.ocx,.dll) that represents the device. Then via commands/(function/method calls) treat it as if it where the device.
Since we are dealing with a simulation (I think), you have to know something about the hardware you are simulating (if you are trying for timing accuracy [timing]), so you'll have to run tests.
Now, just on the off chance that the Windows program needs to give an accurate simulation of what is happening now. Then the firmware needs to be sending back data, telling your software what it is doing now.
:-DSorry! I got carried away and partialy off subject (See first statment).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
I am making a program that copies files with certain file extensions, such as .txt, to other directories that are created by the program.
I am having difficulty using FindFirstFile.
The problem I am having is selecting the directory and all the files with the .txt extensions.
For example, this line of code finds all the txt files in the folder where this program is:
hSearch = FindFirstFile(TEXT("*.txt"), &FileData);
But, I say I need to get all of the .txt files on my c:\txtfiles directory. What is the correct code to do that?
I have tried many things, the one that has worked best is this one.
hSearch=FindFirstFile(TEXT("c:\\txtfiles\\*.txt"),
&FileData);
However with this one if there is more than one txt file in the directory my error will say could not find text files. If I leave just one txt file in the directory it will work.
I am just looking for the correct code to copy all txt files from a directory on my c drive.
Thanks.
|
|
|
|
|
|
u can try about this:
CString szFilePath ,szFileType ,szFileMask ;
szFilePath = "c:\\";
szFileType = "*.txt";
szFileMask = szFilePath + szFileType;
hFile = FindFirstFile(szFileMask,&FindFileData);
while(hFile != INVALID_HANDLE_VALUE)
{
//do copy operation
if(!FindNextFile(hFile,&FindFileData))
break;
}
|
|
|
|
|
Hi all,
I need to use CreateEvent to create handles for many different sound events in my app. When a sound is finished playing, I should get a notification event for it. So I guess I need to use WaitForMultipleObjects and pass that the array of sound event handles. Once the WaitForMultipleObjects call returns, I can get the handle of the particular event that was triggered like this:
dwEvent = WaitForMultipleObjects(
numEvents, // number of objects in array
hEvents, // array of objects
FALSE, // wait for any
INFINITE); // indefinite wait
HANDLE triggeredEvent = hEvents[dwEvent - WAIT_OBJECT_0];
What I'm confused by (I'm brand new to this event stuff) is... ok, so I have the "triggeredEvent" handle. What do I do with it? How do I relate it back to the particular sound object that I'm interested in? The event was created with a name in the CreateEvent call; is there some way for me to extract that name from the handle? Or do I just have to make a hash table of handles and sound objects, and use the handle as a lookup?
Thanks!
Phil
|
|
|
|
|
First of all, let me say that I'm not really a programmer, more of a finance guy. I'd like to develop an analytic tool that I intend to sell to investment firms specializing in fixed income. Having said that, I'd like to get peoples' thoughts about whether I should use Visual C++ or the .NET framework? I want this product to look like a professional Windows app. Any thoughts or suggestions would be greatly appreciated. Thanks!
|
|
|
|
|
Hain I am Also VC++ Guy,but i will suggest you for .Net Based Solution as it is Future
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ajax1971 wrote:
I want this product to look like a professional Windows app.
Making it look like a progessional app, has nothing to do with what eviroment you develop your code in. The looks are on for show and user interaction, which is what makes them happy, it has nothing to do with what the program can do.
The .NET frame work and compiler, gives you more flexibility (both in the front end and back end). I do not use it, but I want the chance of portability in the future (non-windows/microsoft). For what you want, I do not think it matters (unless some possible customers are running non-Windows sytems).
Regardless of which you choose, it is a good Idea to checkout the libraries provided by 3rd parties (for interface design).
In my career, I have loved the details of how to make things work, in the backgroud. The problem with that, it (almost) does not matter. What matters is what the customers sees (if you don't bleed, you're not hurt). So, write your code that can do everything they want (SDE/IDE does not matter), all that matters is what they see (and if it works).
---------------------------------------------------------------------------
Sorry, that's a habit I need to break!
---------------------------------------------------------------------------
Look, you have the knowledge. If you can write the functions/routines to do what is require, then do so. Do not worry about the front end (pretend-it almost does not exist). Once you know that all your code will produce accurate results (which the front end can get), then write the front-end or hire some-body who can.
Note: What is appears to be important is offten not.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
More details needed. Likely details that you have not considered yet.
Are you sure you even want a windows application? Someone once told me that all finance "apps" should be modules for Excell, because your customers all have their data in Excell, and they don't want to leave that program to use yours. I don't know if this applies to you but you need to sit down first and figure out how the customer will use the program, since this can make a big difference. (I don't do this level of stuff, but as I understand it, the much hated visual basic is the only way to go)
As the other guy said: you know finance. Get your financal algorithms working (make sure you cover all the cases, checking with lots of differnet data, including unreasonable values!). Considering hiring a programer to work with you on the project. Consider hiring a user interface guy (NOT the same as a programer) to design the interface. (you still need a programer to impliment the design)
Are you sure you can live with Windows only? There is a small market on Mac and Linux. Sure it may be small, but if you can get 90% of the small market it may be larger than the tiny % you can get of the big market. (See my last bit of advice)
Personally I'd write it in C++ with the qt library, but that is because those are the systems I know.
Since you intend to sell this, start at the library. Get books on writing a buisness plan, and then write your buisness plan. As a finance guy, maybe you know this, but most people just jump in without any idea of how they will make money.
|
|
|
|
|
I was trying to make this (indeed, Click here to download)
code flikker free and so I altered the CCRDTuningDlg::OnPaint() to the following code:
// CPaintDC dc(this); // this was the original code which flickered
// pg->OnPaint(&dc); // this was the original code which flickered
// CDialog::OnPaint(); // this was the original code which flickered
if (!dont_redraw)
CDialog::OnPaint();
CRect rcClient;
GetClientRect( rcClient );
CDC MemDC, *pDC;
CBitmap MemBitmap;
pDC = this->GetDC();
MemDC.CreateCompatibleDC(pDC);
MemBitmap.CreateCompatibleBitmap( pDC, rcClient.right, rcClient.bottom );
CBitmap *pOldBitmap = ( CBitmap* ) MemDC.SelectObject( &MemBitmap );
MemDC.FillSolidRect(rcClient, RGB(224,223,227));
pg->OnPaint(&MemDC);
pDC->BitBlt(95,0,rcClient.right,rcClient.bottom,&MemDC,95,0,SRCCOPY);
MemDC.SelectObject(pOldBitmap);
ReleaseDC(pDC);
ReleaseDC(&MemDC);
dont_redraw = true;
But now the processor shoots up to the maximum as the application starts. Comment the new code and un-comment the old code to see the difference.
I'm an engineer in electronics, so programming isn't my strongest side.
For those who are interested, this program is used to reprogram a Common Rail engine tuning box. By doing this, you can gain up to 40% of power.
Greetz Tom
|
|
|
|
|
dont_redraw = false;
this line has to be added to all on-button functions to make it work completely. But this still doesn't solve the previous problem!!!!
Greetz Tom
|
|
|
|
|
If you don't call CDialog::OnPaint() or create a CPaintDC object then Windows won't know you've handled the WM_PAINT message and will continuously send them to you. Instead of calling GetDC() , use a CPaintDC instead.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thank you very much. Just un-commenting CPaintDC dc(this) was already enough. Great work.
|
|
|
|
|
I have upgraded my C++ 6 project to C++ 7.
A feature I liked in 6 was you could put your debug exe in the file structure that you use (ie move it from the debug folder) and point at it for debugging by using Project-Settings-Debug-Executable for debug session
I can't find out how to do this in C++ 7
All I can find is to right click on the project name in Solution Explorer the choose Properties and under Debuggin I find "Working Directory" but can't find anywhere to input the debug exe path.
Anyone know how to do this.
Thanks
Phil
Phil
|
|
|
|
|
I have a main dialog, which starts several modeless subdialogs.
All these can switch between each other, simply by SetFocus.
However, when a dialog is minimized, I can't bring it back from another (related) dialog.
When I click on its icon on the task bar to restore it (or press Alt-Tab), it receives WM_ACTIVATE, and then WM_COMMAND with SC_RESTORE.
I post WM_SYSCOMMAND with SC_RESTORE, and I post WM_ACTIVATE, it does not matter, and SetWindowPosition to the activating dialog, for following the minimized one in the z-order - all that does not help.
However, what makes it more interesting: IF the dialog, which wants to activate the minimized one loses the focus to any other, UNRELATED dialog, then WM_SYSCOMMAND with SC_RESTORE activates the minimized one.
It may be noteworthy, that the subdialogs have been Created with the desktop as parent (otherwise the main dialog always overlays the subdialogs).
Does anyone know more about this?
|
|
|
|
|
Hello,
I'm trying to figure out the best way to write List control that has sub-items (columns) which are of arbitrary data types that change at run-time (int, COleDateTime, CString, bool, etc.). What is the most efficient way to implement this?
thanks,
JennyP
|
|
|
|
|
Hi All,
I have a application written in MFC and would like to convert it into a dll. Does anyone ahve a idea how to do this?
Vinayak
|
|
|
|
|
Is there a Windows message to intercept for when a new window gets focus? I'm making an app to track my usage of programs, but right now it just calls GetForegroundWindow() ever 1/2 a second. I'm trying to find if there's a message I can just handle so it doesn't execute the code UNLESS a different window gets the focus. right now it only does something if the text changed from last time it checked, which is held in a CString member variable.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|