|
hai,
as a begineer in VC++ 6.0 programmer what are all the areas should i have strong knowledge........?
waiting for ur reply..
thank u'.......... 
|
|
|
|
|
thangvel wrote: as a begineer in VC++ 6.0 programmer what are all the areas should i have strong knowledge........?
Visual C++ 2010?
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]
|
|
|
|
|
thangvel wrote: as a begineer in VC++ 6.0 programmer what are all the areas should i have strong knowledge........?
It is more important to have a solid understanding of the C++ language than any IDE.
|
|
|
|
|
Seriously: The questions you will be asked may depend on how long have you been working on windows programming.
MFC:
Doc/View architecture (along with menus, splitter windows, rebars, scroll views, etc.,)
Dialog applications
Controls
Common controls
Thread basics (MFC thread classes and the hopelessly broken thread sync implementation of MFC)
GDI Basics
Message mapping in MFC (OK, you know it. But how does it work?)
COM (depends if you're into it or not)
Windows API: There's aplenty.
General: OOP, C++ language (very important)
Seriously 2: Use Google.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hi All,
I am having a UI thread and in the controlling function of the UI thread I am doing certain operations , but once the function gets over my thread exits .. so is there anyway i can stop this and make sure the thread exits only when i call suspendthread().
Please help me on this issue
Thanks,
Hari
|
|
|
|
|
Show some code, please, relevant parts should be enough to start with, btw, SuspendThread[^] doesn't "exit the thread", it just suspends its execution.
> 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. <
|
|
|
|
|
This makes me recalling: "The Old New Thing: Why you should never suspend a thread".
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]
|
|
|
|
|
hraman1987 wrote: but once the function gets over my thread exits
How possibly can an UI thread exit without you posting a WM_QUIT to its message loop?
Are you even sure that it's an UI thread? Can you show me your relevant code?
Also, why would you EVER suspend a UI thread? If there are no messages to be processed, the thread is automatically blocked on the message loop.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Sorry Let me rephrase it better ...
My'n is a DialogBased Application .... in dialog class i create a thread..
m_pThread = AfxBeginThread(RUNTIME_CLASS(CMyUIThread),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
m_pThread->ResumeThread();
m_pThread->PostThreadMessage(WM_MYTHREADMESSAGE,NULL,NULL);
Thread Class:
void MyConsumerThread::MyConsumerThreadHandler(WPARAM,LPARAM)
{
..................
......................
}
My question is once the control reaches the end of this function.. i want the control to saty in the function and not exit it..
Please help me out with this and sorry for bad phrasing of the previous message.
Thanks
|
|
|
|
|
hraman1987 wrote: m_pThread = AfxBeginThread(RUNTIME_CLASS(CMyUIThread),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
m_pThread->ResumeThread();
m_pThread->PostThreadMessage(WM_MYTHREADMESSAGE,NULL,NULL);
My question is once the control reaches the end of this function.. i want the control to saty in the function and not exit it..
If that's what you need, then using an UI thread is fundamentally wrong. In an UI thread, by blocking the control within a handler, you will block the thread from processing further messages posted to the message loop.
What you need is a worker thread with a spin loop to check for exit condition.
Go with something like:
volatile BOOL bExit = FALSE;
UINT ThreadFunc(LPVOID pData)
{
while(bExit == FALSE)
{
}
return FALSE;
}
void CMyDialog::OnBeginTask()
{
AfxBeginThread(ThreadFunc, myData);
}
When you need the thread to die, set bExit to TRUE . That's all you need. Not an UI thread, no need to derive a class from CWinThread .
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hraman1987 wrote: I am having a UI thread...
There's really no such thing. Do you mean a thread with a message pump?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
DavidCrow wrote: There's really no such thing. Do you mean a thread with a message pump?
Hehe... I've always had the same sentiment. Whoever gave that name to it was probably drunk.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks a lot your suggestions were helpful , i have changed to worker thread and its working fine
|
|
|
|
|
You're welcome. You can mark the helpful replies by clicking "Good Answer".
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hai everybody,
please anyone tell me How to create a MS ACESS database file and add table on it during run time in a dialog based application using VC++ 6.0 ......?
thank u........![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Hi,
The project I'm working on requires to open a bitmap image from a location, display it and then save the image at another location. In this project I use a variable in OnFileSave As Dlg as OPENFILENAME type.
But, I have already used the same variable during file open dialog as a CString type.
The problem is: I need to use the same variable for both the dialogs.
Plzz suggest a variable type that has the features of both CString and OPENFILENAME or any other alternate solution.
Thank you in advance.
|
|
|
|
|
raviteja2020 wrote: The project I'm working on requires to open a bitmap image from a location, display it and then save the image at another location.
That's fine: your requirements are clear.
raviteja2020 wrote: In this project I use a variable in OnFileSave As Dlg as OPENFILENAME type.
What does it mean, exactly?
raviteja2020 wrote: But, I have already used the same variable during file open dialog as a CString type.
You...What?
raviteja2020 wrote: The problem is: I need to use the same variable for both the dialogs.
Usually this can be done.
raviteja2020 wrote: Plzz suggest a variable type that has the features of both CString and OPENFILENAME or any other alternate solution.
I would go with the 'alternate solution'. Anyway you should give us meaningful details.
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]
|
|
|
|
|
CPallini wrote:
raviteja2020 wrote:
In this project I use a variable in OnFileSave As Dlg as OPENFILENAME type.
What does it mean, exactly?
I used a variable named m_imgName in the OnFileSaveAs() Dialog. the variable is of type OPENFILENAME.
CPallini wrote:
raviteja2020 wrote:
But, I have already used the same variable during file open dialog as a CString type.
You...What?
I have used same variable name in another dialog OnFileOpen(). In this dialog the variable is of type CString.
Now the problem is, I would like to declare a public variable so that it can do the work of both the variable types.
So I need a variable type as a combination of CString and OPENFILENAME.
|
|
|
|
|
raviteja2020 wrote: Now the problem is, I would like to declare a public variable so that it can do the work of both the variable types.
So I need a variable type as a combination of CString and OPENFILENAME.
Nope. You don't need that. You may share, for instance, the CString object (and make it interact properly with the OPENFILENAME struct ).
Could you please post the relevant code?
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]
|
|
|
|
|
Initial declaration of the variable:
CString m_imgName;
Using the variables in both dialogs
<pre>
void CSockDlg::OnFileOpen()
{
CFileDialog m_ldFile(TRUE, m_imgName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
if (m_ldFile.DoModal() == IDOK)
{
m_imgName = m_ldFile.GetFileName();
UpdateData(FALSE);
}
}
void CSockDlg::OnFileSaveAs(HWND hWnd)
{
OPENFILENAME m_imgName;
TCHAR szPath[MAX_PATH];
TCHAR szFile[MAX_PATH];
ZeroMemory( &m_imgName, sizeof(OPENFILENAME) );
m_imgName.lStructSize = sizeof(OPENFILENAME);
szFile[0] = '\0';
m_imgName.hwndOwner = hWnd;
m_imgName.lpstrFile = szFile;
m_imgName.nMaxFile = sizeof(szFile)/sizeof(*szFile);
if (1)
{
m_imgName.lpstrInitialDir = szPath;
}
if ( GetSaveFileName( &m_imgName ) == TRUE )
{
}
else
{
}
}
</pre>
Here I've declared the variable again in th OnFileSaveAs() so that my project runs temporarily.
I'll have to remove the declaration from the dialog and have to declare a public variable.
Thank you
|
|
|
|
|
I cannot quite figure out what you are trying to achieve here but you cannot use a single variable as two different types. If you need to share some information that is held in the OPENFILENAME structure, then just make that structure the public variable.
|
|
|
|
|
void CSockDlg::OnFileSaveAs(HWND hWnd)
{
OPENFILENAME ofn;
TCHAR szPath[MAX_PATH];
TCHAR szFile[MAX_PATH];
ZeroMemory( &ofn, sizeof(ofn) );
m_imgName.lStructSize = sizeof(ofn);
szFile[0] = '\0';
ofn.hwndOwner = hWnd;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile)/sizeof(szFile[0]);
ofn.lpstrInitialDir = szPath;
if ( GetSaveFileName( &ofn ) == TRUE )
{
}
else
{
}
}
raviteja2020 wrote: Here I've declared the variable again in th OnFileSaveAs() so that my project runs temporarily.
I'll have to remove the declaration from the dialog and have to declare a public variable.
Variable m_imgName doesn't need to be declared public (needs to be a class member, not a local variable), as it is used in its owner class code.
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]
|
|
|
|
|
raviteja2020 wrote: same variable
Same variable? Or same variable name? Illustrate what you mean with code, please.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
At first learn to clearly describe the problem. This is really often half of the solution.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|