|
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
|
|
|
|
|
...hello,
I have a little problem.
I have a dialog box resource in which i put a Tab Ctrl. Since i need a new Tab Ctrl in the first, under the first, i put another Tab Ctrl.Unfortunetaly this one do not appear at the run-time.
Is anybody has an idea?
Thank for help
R.G
|
|
|
|
|
Hi all,
I tried caching Internet URLs. In that I faced a problem.i.e., After clicking some pages ,Back button helps in getting the Previous pages.But When the Homepage is reloaded , the Back Button should get disabled preventing the Users to go previous pages.
Have any of you come across such problems?? If so , Pls help me Out.
Regards
Maria
maria@sdsindia.com
|
|
|
|
|
I have done gialog based application and now I want to do frame with scrollview, which open when I click a button on my maindialog. I have create a framewindow with its create-funktion and its open but I don't understand how can I set my scrollview within it? I try do it with document template but its need(?) MDI or SDI besed applicatio. Then I try framewindows createview-function but I dont understand how CCreateContext works and its need doctemplate too(?). Actually I want to do some kind of window whitch I can Scroll and I can draw line to it view, a kind of "historydiagram."
I wish you help me,
Tanja
|
|
|
|
|
Hello, I'm writing a client - server application and I have encountered several problems
1) - My server application has to start minimized to tray (no window) and if the user clicks on the tray icon - a popup menu with commands shows - on which you may show the window, etc.
I'm using CSocket to communicate with the server, since it can use archives to transfer(as far as I know you can't do this with CAsyncSocket).
Okay, I can't separate my listen from accept functions - the socket class seem to respond only to OnReceive event. So - it blocks untill it gets connection - after that it's ok. The question here is how to fix that block?
2) - I start my application with SW_HIDE parameter in the CWinApp class - so it has to be invisible, right? But no, after the block, my window shows for a milisecond and hides again. - Any ideas of fixing that?
3) - The UpdateCommandUI on the popup menu (which is not the IDR_MAINFRAME), does not seem to work. Question - why?! (I display it when i receive a notification from the tray icon - WM_RBUTTONDOWN)
4) - It is really strange that my search function for files does not work good also - it works perfect on other apps, but on this one it does not work at all - it eider needs Sleep(250) to work ok - or it stops and locks somehow my sockets.
I will be really thankfull to any WORKING workarounds on theese problems.
Thanks,
Deian
|
|
|
|
|
So - it blocks untill it gets connection - after that it's ok. The question here is how to fix that block? Use a separate thread for your socket communications if you need to respond to UI events while waiting for connections
|
|
|
|
|
Thanks a lot, I will try that.
|
|
|
|
|
Hi:
I´ve create a pointer, don´t mind the type object, and sometime when you want to delete it, this can produce an exception, example when you haven´t initialized the pointer(the error, in this case, will be "Access Violation").How could I catch this error? the problem is that the delete instruction doesn´t catch any exception and doesn´t return any value.
Thanks.
|
|
|
|
|
Always initialize pointer variables to zero, with new or with some other legal pointer value. Use ASSERT_VALID for pointers to MFC objects. Delete will ignore zero pointers so if you take care that any pointer you delete is either zero or points to memory allocated with new you won't have problems. If you want to reuse the pointer variable, zero it after delete.
|
|
|
|
|
I generally use the following macro (the idea originally came from a COM/OLE book 3-4yrs ago):
#define DELETE_POINTER( p ) \
{ \
if( p != NULL ) { \
delete p; \
} \
p = NULL; \
}
So my code is:
fx()
{
CSomeObj pSomeObj = new CSomePbj();
...
DELETE_POINTER( pSomeObj );
}
The macro could easily be updated to include a try,catch block around the delete. If your using MFC you can throw in ASSERT_VALID like the other poster suggested. Or if your not using MFC you can lift the code from the MFC Source to determine if the pointer is valid (validadd.cpp, function AfxIsValidAddress)
Mike
|
|
|
|
|
delete NULL is perfectly valid and does nothing, which is why all pointers should be initialised to NULL, apart from being able to check them for validity. So the above macro only helps if the pointer is NULL, in which case it would do no harm to delete it.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I am writing some test code for a project. I have dozens of messages of a propriety format that I want to display. The messages all take the form of structures where all the data members are public. Rather than manually a control for each element in the structure , is there a way to automatically create a dialog that would display the contents of a specific structure? The only way I can think is to write something to parse the source code . I'd like to be able to drop a control like an ADO data control on a dialog , point it at the structure and let it make a guess of the field types . Then supply an instance at run time for display purposes. Does such a thing exist ?
|
|
|
|
|
Why don't you just add a member function that creates a formatted string containing the structures's data? That way, you only have to write code once and call it when needed.
struct MYSTRUCT
{
int nMyInt;
double dMyDouble;
CString sMyString;
CString GetDataString(CString sVarName)
{
CString sData;
sData.Format("Contents of %s\n"
" nMyInt = %d\n"
" dMyDouble = %lf\n"
" sMyString = %s",
sVarName, nMyInt, dMyDouble, sMyString);
return sData;
};
};
Instead of writing a function that returns a value, you could make the function set an additional value in the struct, but that would make the struct variable use more memory.
struct MYSTRUCT
{
int nMyInt;
double dMyDouble;
CString sMyString;
CString sDataString;
void SetDataString(CString sVarName)
{
sDataString.Format("Contents of %s\n"
" nMyInt = %d\n"
" dMyDouble = %lf\n"
" sMyString = %s",
sVarName, nMyInt, dMyDouble, sMyString);
};
};
At this point, it may be better to write a real live class instead of using a struct, but since I don't know your requirements, that's a call you'll have to make.
Of course, you could just write a global external function to do all that as well.
So many choices, so little time...
|
|
|
|
|
I am using Micrisoft Visual C++ 6.0 compiler in Windows 2000 and I keep getting problems. It sometimes says 'File being used by another process' etc.
Sometimes it even deletes the CPP file when working in the Header. Does anyone know anything about this..
This is causing a lot of probs for me
Thank in advance.
|
|
|
|
|
Hello
How can I get version of MDAC installed on my comp?
Ernst
|
|
|
|
|
file version of "X:\Program files\Common Files\System\ado\msado15.dll"
|
|
|
|