|
of course..
sorry.. but i have to say that i hardly (say never) use c-arrays.. so.. that may be the reason why i didn't notice that..
yeah..
have a nice time..
bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
WHEWWWWWWW!!!!!!
When I read this subject, I thought my secret had been exposed.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Since I started to use STL in my application it depends on the MSVCP60 library. I thought that since STL is a set of template classes it would be static linked, but unfortunately it isn't.
Is there some way to avoid this dependency?
Cheers,
- xico -
|
|
|
|
|
STL need not be linked in. Its a source code thing totally or that's what CG has got me to believe
Nish
One little CD gone,
Then two CDs gone,
Then 5 more gone,
For a total 7 gones,
If I was a CD R,
I'd wanna cry,
Cause I'd be just a goner,
For a nasty CD burner.
[funny how frustration wakes up the poet in me]
|
|
|
|
|
Nope, STL just like anything else can be compiled into a DLL with the methods exported. You will find that the string class does this a lot.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Link with it statically (i.e. libc instead of msvcrt).
Project/Settings: Tab "C/C++". Select "Code Generation" from the drop-list. Select anything suitable that does not contain "DLL" in the drop-list for "Use run-time library:".
/Mike
|
|
|
|
|
Hi!
I am using WINDOWPLACEMENT structure to get and set the size of window. Although the size of the window is correct, the left and top positions remain the same. So, the positon of my window never gets recorded. Does anybody know why?
Thanks,
NC
|
|
|
|
|
WINDOWPLACEMENT holds/sets information about the position info in certain states. It doesn't get/set the current positon of the Window.
Look at...
GetWindowRect()
SetWindowPos() or MoveWindow()
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Feature Article : Sonork = 100.16311
|
|
|
|
|
Does anyone knows where I could find a class that manages a CGI app? Like gets the environment variables, send stream to browser, etc.
I have some problems with the one I'm using right now so I'm looking for another one. I currently use TCGI you can find it at: http://hjs.geol.uib.no/CplusPlus/
Plus, if that class could be easily debugged (the one I use will always exit if I run the app in the console, so I can't debug!)
Thanks!
---------------
http://www.edovia.com
|
|
|
|
|
There's not really a lot of code needed. To get parameteres from post and get, read argv and call getenv(). To compose your HTML, just do couts or printfs.
|
|
|
|
|
Does somebody knows how to Implement a powerpoint slideshow in a view into an MFC application !!!
-= Where men fail, Dream Vision rulez ! =-
"I swear by my life - and my love of it - that I will never live for the sake of another man, nor ask another to live for mine." - John Galt
|
|
|
|
|
I have very simple problem that When I disable the ComboBox which has type "DropDown". It becomes grayed. I want it to be in White Color.
I use "OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)" to change it but it dose not work properly .
I wrote following code
Following are Class Variables
CBrush bkBrush;
CBrush rBrush;
BOOL CMyDialogBox::OnInitDialog()
{
CDialog::OnInitDialog();
. . .
rBrush.CreateSolidBrush(RGB(255,255,255));
bkBrush.CreateSolidBrush(RGB(255,255,255));
. . .
}
HBRUSH CMyDialogBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
switch(pWnd->GetDlgCtrlID())
{
case IDC_COMBO:
pDC->SetBkMode(TRANSPARENT);
if(GetDlgItem(IDC_COMBO) != GetFocus())
hbr = rBrush;
else
hbr = bkBrush;
break;
default:
break;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
Remember that ComboBox has property of Drop Down.
Thanks in advance.
|
|
|
|
|
Use the following code,
if( pWnd->GetDlgCtrlID() == 1001 && pWnd->GetParent()->GetDlgCtrlID() == IDC_CMB )
return (HBRUSH)m_Brush ;
Here theIDC_CMB is the id of the combo box. In general the edit box of the
combo has the ID of 1001. This information is obtained by using Spy++.
But i do not think it will be changed in future.
|
|
|
|
|
Sorry!!!
It is Drop List.
|
|
|
|
|
SKeung (Visitor) Apr 11, 2002
I have writen a program with GUI in C++. It is used to get the many kinds of system message by using SetWindowsHookEx.
I have two functions.
The first is:
void createHook()
{
hMouseHook = SetWindowsHookEx( WH_MOUSE, (HOOKPROC) MouseHookProc, hInst, 0L );
}
The second is:
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam )
{
LPMOUSEHOOKSTRUCT MouseHookParam;
if ( nCode >= 0 )
if ( wParam == WM_MOUSEMOVE )
{
if ( nCode == HC_NOREMOVE )
strcpy(szType, "NOT Removed from Queue");
else
strcpy(szType, "REMOVED from Queue");
MouseHookParam = (MOUSEHOOKSTRUCT *) lParam;
printf("Mouse at X = %d, Y = %d is %s\n\n", MouseHookParam->pt.x, MouseHookParam->pt.y, szType );
/// write to file to show result
f1=fopen("c:\\report.txt","a+");
fprintf(f1, "Mosue Location At ( %d, %d )\n", MouseHookParam->pt.x, MouseHookParam->pt.y);
fclose(f1);
///
}
return ( CallNextHookEx(hMouseHook, nCode, wParam, lParam) );
}
The problem is that if the mouse moves inside the GUI frame, the data can be saved in a text file and printed out on the screen, but the mouse moves outside the GUI frame, the mouse data can be only saved in a text file, but it cannot be printed on the console screen.
The printf seems not to run and by-pass this statement.
Why? plz help me, Hero!!! Thz a lot!!!
|
|
|
|
|
I just quickly browsed through your code and the if-statements at the beginning seem to be missing curly braces, at least the one after if (nCode >= 0).
You know, for kids!
|
|
|
|
|
Have you gotten any ideas how to remove the program (Uninstall programmatically, better not using the Registry)? The EXE is locked while the program is running, so it fails to remove itself
There's a trick with a BATCH-file, but you have to make a little pause before invoking DEL within it to let the app exit first; that's quite a problem too
Any ideas?
|
|
|
|
|
Serge Baltic wrote:
but you have to make a little pause before invoking DEL within it to let the app exit first
Make a loop in the bath!
e.g:
1:
>delete here<
goto 1
I think it was something like that...
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Why don't you create a kit with InstallShield and then you have install and uninstall
Best regards,
Alexandru Savescu
|
|
|
|
|
put a loop in the Batch file to delete specified file in a loop.
(Use ErrorLevel) and go back to the delete command.
This way it will delete the file once the file stops exec and
in the same manner you can delete the Batch file also.
|
|
|
|
|
Hi.
I think the best approach for the problem I am working on is to use the technique Prosise demostrates in his book using the CStdioFile class. It is a good alternative to serialization.
I need a way to edit the display the data in the file, which are most likely texts. I derived a view from CEditView. I looked to CEditView in MSDN and found that it is possible to get a reference of the CEdit object to modify data currently in the CEditView class. However, Visual C++ displays errors when I tried to gain access to CEdit.
Here is the code:
-----
CEdit myEdit = GetEditCtrl() // I saw this function in MSDN
int i = 0;
CString data;
while (myEdit->GetLine(i, data))
{
myCStringArray.SetAtGrow(i, i + 1);
}
-----
The code above is suppose to copy texts from whatever was stored in the CEdit class into an array of CString.
Visual C++ displayed this error:
C:\Projects\TextView.cpp(121) : error C2440: 'initializing' : cannot convert from 'class CEdit' to 'class CEdit'
No copy constructor available for class 'CEdit'
Am I doing something wrong as far as trying access the CEdit within the CEditView?
Kuphryn
|
|
|
|
|
Do you want to read MSDN again?
CEditView::GetEditCtrl
CEdit& GetEditCtrl( ) const;
Return Value
A reference to a CEdit object.
Remarks
Call GetEditCtrl to get a reference to the edit control used by the edit view. This control is of type CEdit, so you can manipulate the Windows edit control directly using the CEdit member functions.
! WARNING Using the CEdit object can change the state of the underlying Windows edit control. For example, you should not change the tab settings using the CEdit::SetTabStops function because CEditView caches these settings for use both in the edit control and in printing. Instead, use CEditView::SetTabStops.
Example
CMyEditView::OnInitialUpdate()
{
// get the edit control and set some initial properties for it
CEdit& theEdit = GetEditCtrl();
// adjust the left margin without changing the right margin
DWORD dwMargins = theEdit.GetMargins();
theEdit.SetMargins(20, HIWORD(dwMargins));
// only accept 10k of text
theEdit.SetLimitText(10 * 1024);
}
|
|
|
|
|
Okay. Thanks.
Key mistake: "&"
Kuphryn
|
|
|
|
|
Yes, but it's a very strong difference.
|
|
|
|
|
I created an MFC Extention DLL, and declare each class in the DLL with AFX_EXT_CLASS. It compiled fine, and the DLL was generated.
Now, I'm using the DLL's classes in a my application. In the application, I just coded something like :
<br />
CPacketAction* ppak;<br />
ppak = new CPacketAction();<br />
<br />
delete ppak;<br />
In the delete code, I got exception. The constructor and destructor didn't do anything, so it's just a problem of memory allocation. But, what's wrong ? It bothered me more than a week, but I couldn't solve it.
The error message in debug window is :
HEAP[TestServer.exe]: Heap block at 003B71E8 modified at 003B7270 past requested size of 80
Could anyone help ?
|
|
|
|