|
Sorry a lot!!!!!!!!
I was only made a mistake in writing this message. but the problem exist.
|
|
|
|
|
Ok, what about the fact that you alloc hWnd and then call SetWindowLong() on a NULL handle ?
...cmk
Save the whales - collect the whole set
|
|
|
|
|
good afternoon, all
I got all the messege every time I used dev studio debugger.
Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\GDI32.DLL', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\COMDLG32.DLL'
Loaded 'C:\WINNT\system32\SHLWAPI.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\SHELL32.DLL', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\WINSPOOL.DRV'
Loaded 'C:\WINNT\system32\mpr.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINNT\system32\OLEAUT32.DLL'
Loaded 'C:\WINNT\system32\OLE32.DLL', no matching symbolic information found.
The program 'C:\DEV\C++\Billing\ChkCalc\Debug\ChkCalc.exe' has exited with code 0 (0x0).
the MSDN says "This occurs if you have installed a Microsoft application that updates core system files, such as COMCTL32.DLL or OLE32.DLL, to versions that are newer than the operating system version or service pack for which you have installed symbols."
would this effecting my application though? how could I get rid of them without delecting some useful apps? thank you!
|
|
|
|
|
wrote:
how could I get rid of them
I am going to guess that you mean getting rid of the error messages. You can get rid of the error messages by installing the debug symbols.
I might be wrong but I think that you can safely ignore those particular messages.
|
|
|
|
|
This has no effect on your program and can be ignored.
I do not know if there is any way to get rid of them, nor why you would want to.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
If you are using VS7 or later, there's a way to automatically obtain the symbol files for Microsoft DLLs. Once you have it configured (it only requires setting an environment variable) the IDE will automatically download the symbol files from a Microsoft server and store them in your machine.
In this link you can get the details about how to Use the Microsoft Symbol Server to obtain debug symbol files[^]
--
jlr
http://jlamas.blogspot.com/[^]
-- modified at 0:41 Wednesday 31st August, 2005
|
|
|
|
|
is the FilePointer set and got through SetFilePointer and GetFilePointer same for reading and writing?
If yes, Does it mean I cannot read and write from/to different locations of the file at the same time?
Thanks.
|
|
|
|
|
You cna't have a file open more than once, only one thing at a time can open it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Huh?
Sure you can, you just have to NOT deny shared read and write access.
I think you can not 'simultaneously' read and write using the same FILE handle at the same time. You have to update the file position yourself prior to each read and write. And I would make darn sure they were atomic, in case your reading and writing are in separate threads. At which point it would just be easier to open the file twice, get a separate handler for reading and a separate handle for writing.
|
|
|
|
|
You can share access to a file, but you can not read and write to the file at the same time.
MSDN->SetFilePointer->Remarks:
"You must synchronize access to shared resources."
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Whenever you create/open a file via CreateFile() you get an opaque handle, but behind the scenes a structure is allocated to maintain state information for that handle.
This state contains a single variable that represents the current position in the file.
So, with proper file sharing parameters to CreateFile(), you could open the same file with 2 CreateFile() calls, getting 2 handles. Each handle maintains its own file position state.
Therefore, you should be able to use 1 handle to write and the other to read.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
What do you mean "read and write at the same time"? Single processor, etc . . .
All you have to do is store your last read pointer and write pointer and jump between them.
So you do:
read some information from the file<br />
GetFilePointer and store the value in your read pointer variable<br />
SetFilePointer to write pointer variable value<br />
do some writes<br />
GetFilePointer and save the value in your write pointer variable<br />
SetFilePointer to read pointer variable value<br />
etc.
Does this do what you want to do?
|
|
|
|
|
Is there a way to override OnIdle using a Dialog based app?
something like:
BOOL MyDialog::OnIdle()
{
// My code
}
|
|
|
|
|
|
The easiest way I found is to handle the WM_KICKIDLE message.
#include afxpriv.h
...
ON_MESSAGE(WM_KICKIDLE, OnIdle)
...
LRESULT CMyDialog::OnIdle(WPARAM, LPARAM)
{
return 0;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi all,
I'm using CTaskbarNotifier (found it here) to display a popup. It works just fine, but now I want it to change it's shape when the mouse is over.
I added a m_biHoverSkinBackground member variable, and it's corresponding with and height properties.
I modified the OnMouseHover function, like this:
LRESULT CTaskbarNotifier::OnMouseLeave(WPARAM w, LPARAM l)
{
if (m_bMouseIsOver==TRUE)
{
m_bMouseIsOver=FALSE;
RedrawWindow();
}
return 0;
}
The OnMouseLeave function was also modified. and in the OnEraseBkgnd function I added this:
if (m_bMouseIsOver)
{
SetWindowRgn(m_hHoverSkinRegion, true);
GetObject(m_biHoverSkinBackground.GetSafeHandle(), sizeof(bm), &bm);
pOldBitmap=memDC.SelectObject(&m_biHoverSkinBackground);
}
else
{
SetWindowRgn(m_hSkinRegion, true);
GetObject(m_biSkinBackground.GetSafeHandle(), sizeof(bm), &bm);
pOldBitmap=memDC.SelectObject(&m_biSkinBackground);
}
I also changed the code so that where it asks for the skin width/height, it gets the current skin width/height (depends if the mouse is over or not).
The problem is that it works when the mouse is over: the region and bitmap changes, but when the mouse goes out, the bitmap changes but not the region, it stays with the "mouse-over" region...
can anyone give me a hint why it's not working as it should?
thanks a lot!
|
|
|
|
|
I'm trying to call message box function:
<br />
MessageBox(NULL, TEXT("Configuration file is corupted. Loading standart settings."), TEXT("Error"), MB_OK);<br />
but linker returns error:
Автонапоминалка 3.0 error LNK2001: unresolved external symbol "int __stdcall MessageBoxA(struct HWND__ *,char const *,char const *,unsigned int)" (?MessageBoxA@@$$J216YGHPAUHWND__@@PBD1I@Z)
Am I doing somthing wrong?
|
|
|
|
|
Maybe because the configuration file is corrupted!! you should load standard settings
I am Kidding only, but know something?
The Visual Studio sometimes fools out for no reason, sometimes i get errors that make no sense, maybe some professionals has faced a situation that a very basic line of code doesnt work, and it just doesnt work, for no obvious reason.
I sometimes getout from such a problem (when u are very sure of what u are doing but the compiler just rejects your code) by creating a new clean project and move my code to it. it works 99% of the time, why should I worry about the other 2%???
Albert Einsitein said once: The most foolish person in the world is one who makes a test, and then redo it with the same arguments and expecting different results.
well, it works sometimes with computers, who knows why???
This is not a solution, its a suggestion
Regards,
Mohammad
|
|
|
|
|
Hi
I have two MFC simple dialogue based exe. Say First.exe and Second.exe
I have put the code in my First.exe from which I start Second.exe using CreateProcess.....Like :
FirstDlg::OnInitDialogue()
{
..........
..........
CreateProcess("C:\Second.exe",.......);
..........
..........
return;
}
Now my problem is : After starting both the application the Second.exe receives the focus. I want to set the focus on my First.exe And for that I have used ::SetFocus(hWnd,0) function but am not able to do that.....still the second.exe receives the focus...any idea how to do this ???????
Advance in Thankx
Raj Mehta
India
|
|
|
|
|
Try this instead:
VERIFY (NULL != ::SetActiveWindow (AfxGetMainWnd()->GetSafeHwnd()));
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi
I have tried it but it doesn't works...
Any idea or any other functions that can give focus to my window
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Try waiting a couple of seconds (use Sleep() ) after starting the second app before calling SetActiveWindow() . It's possible that the first app does in fact become the active window, but eventually relinquishes that state to the second app.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I am having trouble overiding the default tooltip text that displays the tick count in a slider control.
My code is below. Any suggestion is greatly appreciated.
void CGraphView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
static CString strMinutes;
CToolTipCtrl *pTool;
if ((CSliderCtrl*)pScrollBar == &m_Slide &&
(nSBCode == SB_THUMBPOSITION || nSBCode == SB_THUMBTRACK)
)
{
pTool = m_Slide.GetToolTips();
strMinutes = "Test";
pTool->UpdateTipText(strMinutes, this);
pTool->Update();
}
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
sharpanil@yahoo.com
|
|
|
|
|
Hello,
I am using MSVC6 and have some trouble using the #pragma pack(...).
I have a header file where a structure is implemented:
<br />
#pragma once<br />
#pragma pack(push,8)<br />
<br />
struct MyStruct {<br />
};<br />
<br />
#pragma pack(pop)<br />
This structure I am using in two different cpp files in two different projects. If I am applying the sizeof() Operator to this structure in both projects I get two different results. Why??? I think I am using the #pragma pack directive properly.
By the way, the settings in "C++" -> "Code Generation" -> "Struct memeber alignment" is set to 8 bytes.
So has anyone an idea how this can be fixed???
Thank you very much for help
Chris
|
|
|
|
|
Try commenting the #pragma pack statements out and rebuild everything and see what happens.
You really don't need to do this if you are setting it to 8 though because that is the default.
Actually, it is a bit of a misnomer too. The compiler will align data members to the size of their type when this is selected. This is really only important when transmitting data structures between computers. However, you want to use the default whenever possible especially when using P4 processors. They can slow down considerably if their data is not aligned correctly.
|
|
|
|