|
Got it... apparently it is dependent on the order of declaration, just like non-static members. Thanks, Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
|
tell me proper way to add an item to ListCtrl.
Here is my code:-
#define WM_MYMESSAGE (WM_USER+1)
-------------------------------------------------------
class CMyThread : public CWinThread
{
DECLARE_DYNCREATE(CMyThread)
.
.
.
public:
unsigned int f0ll, f1ll, f2ll, f3ll;
unsigned int f0ul, f1ul, f2ul, f3ul;
public:
afx_msg void MyMessageHandler(WPARAM, LPARAM);
-------------------------------------------------------
.
.
.
afx_msg void CMyThread::MyMessageHandler(WPARAM, LPARAM)
{
}
BEGIN_MESSAGE_MAP(CMyThread, CWinThread)
ON_THREAD_MESSAGE(WM_MYMESSAGE, MyMessageHandler)
END_MESSAGE_MAP()
-------------------------------------------------------
.
.
.
void CIPMDlg::OnBnClickedBrefreshdevices()
{
.
.
.
pRefreshThread = AfxBeginThread(RUNTIME_CLASS(CMyThread));
pRefreshThread->PostThreadMessage(WM_MYMESSAGE, 0, 0);
} Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
If "MyThread" is not the thread that owns the ListCtrl, then you will have problems.
You must add items to the ListCtrl only from the thread that created the ListCtrl.
|
|
|
|
|
CIPMDlg class created the ListCtrl
should I post a message back to the main thread's message pump to add item to ListCtrlFuture Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Manmohan29 wrote: should I post a message back to the main thread's message pump to add item to ListCtrl
Yes."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I need to find out (in a release version) how much memory has been allocated after loading (a large) object - the object itself is loaded by a DLL (if that's relevant). I am looking at GlobalMemoryStatus but not sure sure which properties I should use to get accurate information...
Help welcome!
Jerry
|
|
|
|
|
Hi,
I am starting a project where in I have a dual monitor setup for shown objects.My project involves showing squares, circles, lines on the screen. I use the primary monitor to control the attributes and the second monitor solely for display. I have issues setting up these two windows/frames; one in each monitor using MFC app wizard. I am at loss as to which model I should use: SDI or MDI. Any ideas, pointers to existing projects, directions are more than welcome..
rgds,
-K
|
|
|
|
|
As a final user, in general I hate when an application want to decide itself how to set the the spaces into my desktop.
Unless you are in a very captive environment (PC running your application only, may be on a synoptic etc.), the best way is to operate on two different frames and let the user to decide where those frames must go and how they have to be sized.
What you can do is save the frames positions (may be in registry, or in a "state file", into the user data directory) so that they can be placed the same among different invocations.
Using SDI or MDI is than much more a matter of the complexity of the frames content, than the fact there are two of them.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
What Visual Studio version are you using?
I did some multi-monitor work in VS6 in C, at an SDK level (i.e. not using MFC.)
If you don't find a solution, let me know and I will dig out some brute-force code I used to detect the number of monitors and position windows on the different monitors. It's not elegant but it works. As I said, it would be straight C stuff, not MFC - I never got into that complicated stuff!
|
|
|
|
|
Hello,
I need to call some how non-exported functions of a DLL.All non exported functions don't have any table at all to which some looks up and find entries.
If some how we track the exact place where non exported function lies inside PE, copying or duplicating their entries in export table of that DLL of whom non exported functions I am interested in to call (until I need those non exported functions) and releasing those after done..
Any suggestions or recommendations?
Regards
Muhammad Usman Khalil
|
|
|
|
|
If they are not exported then I do not think there is any way you can find them. Exported functions are only 'visible' because the LIB processor puts information in the DLL to make them so. Non-exported functions do not have this extra information so there is no way you can find them.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Can you try LoadLibrary and GetProcAddress?
-Saurabh
|
|
|
|
|
Hi there,
I have given this application that includes a dll and ini file that has to be in system32 folder in Windows machine and another VB application that uses the dll and ini to display the activities of the application. there is also another application that is Linux based and runs on Ubuntu to have just one server I want to install and run the application on the Linux based server by using Vine virtual machine. My problem is that I am not sure how I can change the C++ application code to read the dll and ini files from another folder (i.e. C:\Application) rather than Windows32 folder. Here is what the application have in config class (of course the original programmer didn't provide any comments or documents and the application is more than 15000 lines of code):
.h:
#ifndef __CfgClass_H__
#define __CfgClass_H__
#include <windows.h>
#include <windowsx>
#include "stdafx.h"
.cpp:
memset( CfgFilePath, '\0', MAX_PATH );
if( GetSystemDirectory( tmpFile, MAX_PATH )== 0 )
{
return;
}
wsprintf( CfgFilePath, "%s\\Application.ini", tmpFile );
Any help will be appreciated.
Regards,
Chan
|
|
|
|
|
Take this code:
wsprintf( CfgFilePath, "%s\\Application.ini", tmpFile );
and change it to:
wsprintf( CfgFilePath, "%s\\Application.ini", "<code>C:\\NewPath</code>");
|
|
|
|
|
|
Hi
I Execute the following sql statement successfully for a Database connected to my CDaoDatabse Object.
CREATE TABLE Scores (
StudentCode Text(9) NOT NULL,
CourseCode Text(7) NOT NULL,
SemesterCode Text(3) NOT NULL,
Score Double
);
CREATE TABLE Courses (
CourseCode Text(7) NOT NULL,
CourseName Memo NOT NULL,
CourseTypeID Integer NOT NULL,
CourseCategoryID Integer NOT NULL
);
ALTER TABLE Scores ADD CONSTRAINT PK_Grades
PRIMARY KEY (StudentCode, CourseCode, SemesterCode);
ALTER TABLE Courses ADD CONSTRAINT PK_Courses
PRIMARY KEY (CourseCode);
ALTER TABLE Courses
ADD CONSTRAINT UQ_Courses_CourseCode UNIQUE (CourseCode);
But Finally I Get Error message(Syntax error in CONSTRAINT clause.) on this satement that is at the end of my execution list.
ALTER TABLE Scores ADD CONSTRAINT FK_Scores_Courses
FOREIGN KEY (CourseCode) REFERENCES Courses (CourseCode)
ON UPDATE CASCADE;
And I don't know Why
|
|
|
|
|
I'm trying to the the SetElementProperty with the CDHtmlDialog, but can't figure out how to get the DISPID of the property to set. Can anyone point me in the right direction?
CDHtmlDialog seems pretty impressive, but I can't find a lot of coding examples using it.
Thanks much - Kevin
|
|
|
|
|
Hi All.
I can copy a text and then can programatically paste the same on top of any text editor.
Now, what I want to do is...
If I have a file in the clipboard (Ctrl+C) and then want to paste the same onto any open folder, then How can I do that?
I tried to send Ctrl+V to the window but I am unable to get the result.
Can someone please provide me some pointers, so that move ahead?
Please let me know, in case any clarification required.
Thanks
PanB
|
|
|
|
|
With open folder you mean explorer's windows? And since you tried to send Ctrl+V to the window i assume you know its handle. Try using Spy++ to see what command/message the window gets if the user selects "Paste" from the window's edit menu and then try sending the same to the window yourself, maybe it will get you what you want, maybe not, but it is worth a try. > The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi everybody
I need to add a new item in the open with context menu of explorer.
I added a new item in the main context menu using shell extensions samples.
But can anybody tell me how to get the handle of Open With context menu so that i can add my items to it.
Thanks in advance.
Regards
Deepumodified on Thursday, February 11, 2010 8:04 AM
|
|
|
|
|
|
|
Hi,
I have an application which is in pure c, I want to communicate through my MFC application. I looked the code of that application, some message are there like SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP. What it means?
And if I send message from my application to that application how can I achieve that.
|
|
|
|
|
When communicating with another application, you should first register a window message (see RegisterWindowMessage) and then use PostMessage (don't use SendMessage ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|