|
nombrecinq wrote:
Can somebody tell me what I need to do to create an open document dialog box?
Does this imply that you are working on an SDI or MDI application?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Neither actually, it's a dialog based program because there's only a couple things the user can do.
|
|
|
|
|
So is CFileDialog what you are looking for then?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yep that's it thanks, I got that working now but I have another question so I'll post it.
|
|
|
|
|
I want to serialize the CGridCtrl in order to use Keith Rule's "Simple and Easy Undo/Redo". Can anyone give an example of a Serialize routine implemented in CGridCtrl ?
Thanks.
Regards,
Cosmin Unguru
|
|
|
|
|
Hi all,i want to remove a section in ini file using VC code,but i don't how to do it.Can you help me?
i.e:
[Test]
name = example
how to remove section [Test] out of this ini file?
|
|
|
|
|
check will this api help [WritePrivateProfileSection] other wise you have manually read and delete the entry
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Ok Found it, this article will help
http://www.codeproject.com/file/CIniFile.asp[^]
Remember One thing,here people don't help person who make ANONYMOUS request
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Remember One thing,here people don't help person who make ANONYMOUS request
But you did all the same!
|
|
|
|
|
Stlan wrote:
people don't help person who make ANONYMOUS request
But you did all the same!
I Said People not Programer
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
The documentation for WritePrivateProfileString() clearly states that if the lpKeyName parameter is NULL , the entire section, including all entries within the section, is deleted.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi all!
I have a thread problem in the following code:
(This is not the complete code..)
Somewhere in a function i have the following implementation:
/*****************************************/
// Start of thread
HANDLE hThread = CreateThread(...);
// Wait until thread ends
WaitForSingleObject(hThread, INFINITE);
...
/*****************************************/
// Thread procedure
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
// My code
......
......
SendMessage() <--- The system right here is deadlock (***)
return 0;
}
(***)
The SendMessage() function sends message (LVM_INSERTITEM) to a list view control of the window that stared the thread.
The problem is that I want the SendMessage() function to work, without removing the WaitForSingleObject() function, or any other "wait" function it might need to be replaced.
Thanks for any reply!
|
|
|
|
|
This will never work !! I suppose the function which creates the Thread is not in another thread than your application ? Thus your application will freeze because of the WaitForSingleObject call. And because of that, it cannot process messages anymore (so it will not respond to user events neither).
It is not a good idea to call WaitForSingleObject in the main thread. A better idea would be that, when your secondary thread finishes, it sends a message (an owner defined message) to the main window resulting in calling a specific function that will manage every that needs to be done when your thread finishes.
|
|
|
|
|
Hello,
What you are doing is asking for trouble! The rule of thumb is: never touch the GUI from your worker thread!!!!
If you really need to do this, try the following: use PostMessage() instead of SendMessage() .
If you really need to wait for the thread to finish, use MsgWaitForMultipleObjects() instead of WaitForSingleObject() . This way, your app won't freeze because it will process messages.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
how to develop an assembler in C++
the idea that i got was
__asm {
}
but do anyone have any idea more abt that?
|
|
|
|
|
emusing wrote:
how to develop an assembler in C++
This sentence means nothing ! For me, assembler is a low-level language. So, how can you 'develop' a language ??
Otherwise, yes with __asm you will be able to use write assembler code inside your C++ code. But that does not mean you are developping an assembler.
|
|
|
|
|
cedric moonen wrote:
For me, assembler is a low-level language. So, how can you 'develop' a language ??
yes but you well need an interpreter or a compiler for your language to work...
i think it is what this guy is talking about with bad-used words...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
cedric moonen wrote:
For me, assembler is a low-level language.
This is not true, an assembler is a program that translates assembly language into machine code.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Start some reading about parsers, interpreters and compilers...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
How to invoke Audio Device testing/tunning wizard.
I am using VC++ 6.0. and dont want to use DirectX feature of IID_IDirectPlayVoiceTest, because it has some limitations.
Quaidian Once, Quaidian For Ever
|
|
|
|
|
One of my program must wait that file arrive intot a directory.
I have made a infinite cycle with a thread.
a progress bar is used we can stop it by pressing a button
When the thread starting all the CPU is used and other program do runtime error
where is my problem ?
i need help.
my code:
// WaitModAuto.cpp : fichier d'implémentation
//
#include "stdafx.h"
#include "ScanOne.h"
#include "WaitModAuto.h"
// Boîte de dialogue CWaitModAuto
volatile int g_nCount,i_gMaxCount;
CEvent g_eventStart; // creates autoreset events
CEvent g_eventKill;
UINT ComputeThreadProc(LPVOID pParam)
{
volatile int nTemp;
::WaitForSingleObject(g_eventStart, INFINITE);
TRACE("starting computation\n");
for (g_nCount = 0; g_nCount < i_gMaxCount;
g_nCount++) {
for (nTemp = 0; nTemp < 10000; nTemp++) {
// Simulate computation
}
if (::WaitForSingleObject(g_eventKill, 0) == WAIT_OBJECT_0) {
break;
}
}
// Tell owner window we're finished
::PostMessage((HWND) pParam, WM_THREADFINISHED, 0, 0);
g_nCount = 0;
return 0; // ends the thread
}
IMPLEMENT_DYNAMIC(CWaitModAuto, CDialog)
CWaitModAuto::CWaitModAuto(CWnd* pParent /*=NULL*/)
: CDialog(CWaitModAuto::IDD, pParent)
{
}
CWaitModAuto::~CWaitModAuto()
{
}
void CWaitModAuto::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CWaitModAuto, CDialog)
ON_MESSAGE(WM_THREADFINISHED, OnThreadFinished)
ON_WM_TIMER()
ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
END_MESSAGE_MAP()
// Gestionnaires de messages CWaitModAuto
BOOL CWaitModAuto::OnInitDialog()
{
CDialog::OnInitDialog();
g_nCount=0;
i_gMaxCount=i_mMaxCount;
AfxBeginThread(ComputeThreadProc, GetSafeHwnd());
i_mTimer = SetTimer(1, 1000, NULL); // 1/10 second
ASSERT(i_mTimer != 0);
g_eventStart.SetEvent();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CWaitModAuto::OnTimer(UINT nIDEvent)
{
CProgressCtrl* pBar = (CProgressCtrl*) GetDlgItem(IDC_PROGRESS_WAIT);
pBar->SetPos(g_nCount * 100 / i_gMaxCount);
CDialog::OnTimer(nIDEvent);
}
void CWaitModAuto::OnBnClickedCancel()
{
if (g_nCount == 0) { // prior to Start button
// must start it before we can kill it
g_eventStart.SetEvent();
}
g_eventKill.SetEvent();
OnCancel();
}
LRESULT CWaitModAuto::OnThreadFinished(WPARAM wParam, LPARAM lParam)
{
OnOK();
return 0;
}
|
|
|
|
|
Hi and thanks in advance,
I have implemented a DLL language system for my app, but I can’t open the dialogs with a DLL language loaded if this contents any custom control. When I do the dialog.DoModal (); it returns some error (I think it is caused by some template), the dialog don’t appear and the execution continues. If I try to open the same dialog without have loaded any DLL or if the dialog doesn’t contents anyone custom control, the system runs properly. I don’t know what can I do.
Your help will be appreciate, thank you very much.
|
|
|
|
|
I want to insert icons on to any cell in the FlexiGrid control. Does anybody know how to go about this?
Sharat
|
|
|
|
|
I have to develop an assembler based on the below processor description :
M05 is a new generation processor from Lintel Technologies. It is a simple 16 bit
multipurpose processor targeted for consumer electronic devices .It has a 16 bit accumulator
A , 16 bit flag register , a 16 bit data register D and a 16 bit memory pointer register P .
It also has a 16 bit Program Counter register PC and a Stack pointer SP.
It supports the following instructions .
* Move immediate data to A,D,P and SP
* Move data pointed by P register to A or D
* Perform arithmetic operation on A register with D register( add ,sub , adc , sbb ,xor
,or ,etc)
* Move data in A register to memory pointed by P
* Call subroutine and return
* Unconditional and conditional jump ( ie jump or carry etc)
* Jump to or call to address pointed by A
The registers A and D can be accessed as 8 bit units ( AH ,AL , DH , DL)
List down the set of all possible instructions and assign your own opcodes. Your assembler
should accept decimal and hexadecimal data . HExadecimal numbers start with a '0' prefix and
terminate with a literal 'H' - for example 0FFEFH . Any text that follows ";" in the same
line should be treated as a comment . Assure that the assembler is case insensitive.
|
|
|
|
|
Good luck with that pal!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|