|
I recommend Hewlett Packard implementation, it is free and - that's my opinion - better then Ms implementation.
Use STL and save money. Just like when writing 3d applications, use fe.: OpenGL or DirectX.
|
|
|
|
|
Hi.
> Finally, whilst Im here can I also ask whats the difference between including things
> with < and >, and in speech marks...
Easy:
#include <stdio.h> searches stdio.h in the defined include directories while
#include "stdio.h" searches the file first in the current directory and then in the standard include dirs.
Thus, use <> for standard files or standard modules you use often and "" for your own files the current project.
Karl
Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software.
|
|
|
|
|
Hello,
I would like to stop a service programatically, do you know how to do it?
As always, thank you very much.
|
|
|
|
|
Use OpenService to obtain a service handle. Then, call ControlService with SERVICE_CONTROL_STOP control code.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
With
BOOL ControlService(
SC_HANDLE hService, // handle to service
DWORD dwControl, // control code
LPSERVICE_STATUS lpServiceStatus // status information
);
Good Luck!!!
Carlos Antollini.
|
|
|
|
|
Hello,
ENVIRONMENT:
Win2k
MVC++6 (sp.4)
simple WIN32 app: not MFC.
I would like to avoid the user to be able to press any "system key" (ALT+TAB, CTRL+SHIFT+ESC...).
I have a MFC application that does this very fine, but the problem I've found is that I get the keyboard controlled but I cannot ensure that the user won't use any of those keys while my application is being initialized. (it's slow because first I must wait for a service to start) (that app is an MFC one).
I've thought of trespassing the code that is now in my application to a service of my own in order to use the same but before the user has logged in.
The trouble is that I don't know how to avoid the error "undeclared identifier" with:
LPKBDLLHOOKSTRUCT and WH_KEYBOARD_LL (they are defined in winuser.h but I've added this header and nothing has changed)
could you give me an advice?
As always, thank you very much for your help.
|
|
|
|
|
The definitions you're trying to access are in the #if/#endif block:
#if (_WIN32_WINNT >= 0x0400)
#endif
Add the following line before #include <winuser.h> :
#define _WIN32_WINNT 0x0400
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
first of all let me thank you your help, but I'm a novice and I'm still having some problems:
if I define the _WIN32_WINNT 0x0400 then I get 36 errors that are like:
UNRESOLVED EXTERNAL SYMBOL __imp__SetWindowsHookExA@16
UNRESOLVED EXTERNAL SYMBOL...
If I try to include the winuser.h in the same cpp file then I get errors in the winuser.h ile (I think I must be missing some header file again)
Do you know what's happening?
At last, thank you again.
|
|
|
|
|
To avoid linker errors, add user32.lib to the list of libraries your project uses (Settings/Link/Object & library modules).
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
So... it seems like you want your app and prevent the user from shutting it down while it slowly starts up, right?
If this is what you want, let me suggest a better way. Simply display some sort of splash screen that indicates the progress of the startup. This will make the initial wait more tolerable and give the user feeback as to what's going on.
I just don't think you should take away the user's ability to shut your (or any other) app down. Imagine if it was done to you how you'd feel.
Regards,
Alvaro
|
|
|
|
|
I have loaded a dll in one thread, and then released it from the other thread. I am getting errors some times. is this is possible to load a dll in one thread and then releasing from the other thread. the handle of the dll is on the global scope.
|
|
|
|
|
Standard or mfc extension dll?
|
|
|
|
|
I'm trying to code a little utility to save icon positions but I'm
getting errors with my code. Can anyone see what I'm doing wrong?
Heres the code:
//----------------------------------------------------------------------------------------------------------
void StoreIconPositions()
{
//get screen dimensions
int cX = GetSystemMetrics(SM_CXSCREEN);
int cY = GetSystemMetrics(SM_CYSCREEN);
//convert to a string
string FileName = itos(cX) + itos(cY) + ".txt";
//try and open the file. If fail then we create a new file
ofstream out(FileName.c_str(), ios::trunc);
//get handle to desktop
HWND hwndLV = GetTopWindow(GetTopWindow(FindWindow("ProgMan",
NULL)));
//get number of items
int nMaxIcons = ListView_GetItemCount(hwndLV);
for(int nItem = 0; nItem < nMaxIcons; nItem++)
{
char IconName[MAX_PATH];
POINT pt;
//**************THIS IS WHERE IT CRASHES***********//
// Get the name and position of a listview item.
ListView_GetItemText(hwndLV, nItem, 0, IconName, MAX_PATH);
ListView_GetItemPosition(hwndLV, nItem, &pt);
// Save the name and position
out << IconName << endl << pt.x << endl << pt.y << endl;
}
return;
}
//----------------------------------------------------------------------------------------------------------
Thanks for any help.
fup
|
|
|
|
|
You are passing a pointer to another process (Explorer). The pointer in your app's process space cannot be used in another process, thus the crash.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
So what do I have to do to resolve this problem Mike?
|
|
|
|
|
The way I've seen described is to write an in-process COM server with one object. You also write a separate EXE which calls SHLoadInProc() to have the shell create your COM object. Once that's done, your COM object is running in the shell's process space, and you can then do what you want. The user runs the EXE, and the COM object saves the icon positions.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I have done an alarm app.... a dialog box apears on alarm but if I have focus on another
window the box is in the background!
how??
I use MFC and don't want win32 code help!!
/*
BETA
*/
|
|
|
|
|
Use SetWindowsPos with HWND_TOPMOST.
Regards.
Carlos Antollini.
|
|
|
|
|
Hello all,
I've to rebuild a 'analyser' to a MDI application on which each doc/view output is generated, and sometimes very fast and a lot.
Each doc/view has it's own socket-connection to external equipment. These equipment produces sometimes a lot of 'debugging' information, which is displayed in the doc/view. The communication is via UDP/IP and a fixed protocol using a form of windowing is used.
My problems/questions
---------------------
1. What kind of control is most reliable for fast writing and deleting lines for displaying by the application itself: CEdit or CList (or other control which has past CodeProject). Deleting is required, since we only want to keep x-amount of lines available (preventing memory eating).
2. What is the best way of architecture to implement this, refering on fast
handling and MDI? No user-input is required, only initially to setup the connection. Of course: when a lot of data is being dumped, the controls to buttons for: End Connection, exit application etc has to be remain a bit responsive. That is already a problem in the current application...
Thanks in advance,
EiSl
|
|
|
|
|
> 1. What kind of control is most reliable for fast writing and
> deleting lines for displaying by the application itself: CEdit
> or CList
CListCtrl is much easier to use when you want to insert/delete lines. Also, CEdit has serious capacity limitations on Win9x - don't know how much it affects you.
Are you just putting the information on the screen, or also store it somewhere else in your program for statistics/detailed info etc.? If yes, you can consider using LVS_OWNERDATA style for your list control.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I have a loop that i use to reset checkboxes in a dialogbox.
the setcheck works
the setfont works
but i can not get the settextcolor to work
any input would be appreciated.
for(int i = 0;i < 18;i++){
pButton[i]->SetCheck(false);
pButton[i]->SetFont (&m_checkfont);
pButton[i]->GetDC()->SetTextColor(RGB(255,0,0));
}
|
|
|
|
|
If you want to have captions with specific color, you'll need to use owner-drawn controls. The way you're trying to achieve this effect is totally wrong now - the device context obtained from GetDC isn't used by WM_PAINT handler for checkboxes. Additionally, you have a major GDI resource leak - you're not releasing the context.
Since you apparently have 18 checkboxes, I'd use CListCtrl with LVS_EX_CHECKBOXES extended style. Changing item text color in CListCtrl is easier - CListCtrl::SetTextColor does that.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I'm looking for a tool to convert MSVC RC scripts into HTML, specifically, dialog resources. I have many dialog resources to convert, so I'd rather not do all the work by hand. Any ideas.
|
|
|
|
|
how can i correct this error?
fatal error C1088: Cannot flush compiler intermediate file: 'C:\TEMP\a00202sy': No space left on device
|
|
|
|
|
Isn't the message self-explanatory? Your C: disk is full, try to clean the c:\temp folder.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|