|
If you have a variable for their you can use of m_Static.SetFont(GetFont());
|
|
|
|
|
See the Extras section of this article.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The situation is :
-launch of release application using my COm object => memory leaks when I use Function to get data with an SafeArray.
- launch of release application in VC++ 6.0 with debug => no memory leak.
What is the difference, what are dll that are used? Have someone an explication?
Thank you for a response and help
LOUIS Christian
|
|
|
|
|
Post code, that giving this problem.
|
|
|
|
|
|
Hi,
For some odd reason, I am not able to Register the COleDropTarget.
I have been working with my project for a while, so I suspect it is
something within my project.
I do have the member variable COleDropTarget m_dropTarget in the header.
Then, in the OnInitialUpdate, I call m_dropTarget.Register(this).
// register drop target
BOOL b = m_dropTarget.Register(this);
It keeps failing at the if(CoLockObjectExternal()) shown below.
Does anybody know what CoLockObjectExternal means?
BOOL COleDropTarget::Register(CWnd* pWnd)
{
ASSERT_VALID(this);
ASSERT(m_hWnd == NULL);
ASSERT_VALID(pWnd);
LPUNKNOWN lpUnknown = (LPUNKNOWN)GetInterface(&IID_IUnknown);
ASSERT(lpUnknown != NULL);
if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK)
return FALSE;
|
|
|
|
|
Hi,
I write a dll which will be loaded by different application. Currently, I need to share some data between the same dlls loaded in different processes. How can I do? Is there a simple way?
I consider to use a file to stored the data shared. But I must write/read the data frequently. So I think use file is not a good way.
|
|
|
|
|
|
You can place the data into a shared data segment.
Be sure to protect access to it with some sort of thread-safe synchronization mechanism.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Good day everyone,
I'm doing a project with Vc++6.0 database MS Access
I'm struggling with the connection and coding with database.
Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
Thanks for your help in advance.
|
|
|
|
|
abrakadbra wrote: Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
Here[^]
|
|
|
|
|
See Microsoft Access in this[^] link
|
|
|
|
|
abrakadbra wrote: Does anyone know where I can get a tutorial of how to connect to database and manipulate with data?
I show how to do that here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I keep getting this error from the compiler which I'm trying to decipher (if it even is an error), that pops up and misteriously disappears with no realation to the changes I've made to the code.
ReflectRefract virtual void * __thiscall std::length_error::`vector deleting destructor'(unsigned int)" (??_Elength_error@std@@UAEPAXI@Z) from CChildWndArranger.obj
Replaced symbol(s):
"public: virtual void * __thiscall std::logic_error::`scalar deleting destructor'(unsigned int)" (??_Glogic_error@std@@UAEPAXI@Z) from CChildWnd.obj
"public: virtual void * __thiscall std::out_of_range::`scalar deleting destructor'(unsigned int)" (??_Gout_of_range@std@@UAEPAXI@Z) from CChildWnd.obj
and this other error
ReflectRefract virtual __thiscall std::length_error::~length_error(void)" (??1length_error@std@@UAE@XZ) from CChildWndArranger.obj
Replaced symbol(s):
"public: virtual __thiscall std::logic_error::~logic_error(void)" (??1logic_error@std@@UAE@XZ) from CChildWnd.obj
"public: virtual __thiscall std::out_of_range::~out_of_range(void)" (??1out_of_range@std@@UAE@XZ) from CChildWnd.obj
I'm using VS .NET 2002 sp1. Help would be greatly appreciated.
|
|
|
|
|
Can you show code, probably causing this error?
|
|
|
|
|
I am working on an MFC application (Visual Studio/C++) that has to grab a screen shot from a frame grabber and send it to the default printer with landscape orientation. This has to be done with no operator intervention other than clicking on a "Print" button in the main dialog - no preview or print dialog. I'm able to grab the frame, but I'm having no success with the printing.
Any help would be greatly appreciated.
Bob.
|
|
|
|
|
How to send and what happen when you send?
|
|
|
|
|
CPrintDialog dlg(FALSE);
dlg.GetDefaults();
If the call returns non-zero, will have filled in everything, including a printer DC. You can then use this to do your printing, although if you want landscape, you will need to alter the DEVMODE stuff to suit.
Steve S
Developer for hire
|
|
|
|
|
Thanks for the suggestions.... I think I should have worded my original question a little better though.
What I have is not a "bitmap" in the MFC sense, but a pointer to a big bunch of pixels. I can't seem to figure out how to get these in a form that can be printed - what comes out on the printer is just a black rectangle.
Thanks in advance...
Bob.
|
|
|
|
|
I have completed this dialog window reading in filenames and a progress bar to indicate progress. A timer is used to update the progress bar.
However, when I called a C procedure that is computationally intensive, all the edit boxes and menu went blank. The worst thing was that the progress bar was not incrementing. Do take note that the program is running fine except for these side effects. The processed output was tested to be correct.
Before I include the C procedure, testing was done to make sure the dialog windows work well with the progress bar etc.
Please advise if the computationally intensive C procedure resulted in this issue. If yes, how do I overcome it.
searcher08
|
|
|
|
|
Your app needs to be multithreaded, so the UI updates while your code is taking up lots of CPU. Otherwise, the paint messages are not handled, and your window is not drawn.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Can I look your code! May be I can make it better! and then sent it to you.
---++Xu Shanghua
|
|
|
|
|
You send a thread to Mr Christian Graus you can answer directly to sender question
|
|
|
|
|
I have not done multi-threading before but looking at the reference books and online tutorial, they are all related to classes or objects. I am only calling a C procedure with a parameter in it.
The function needs to be in this form. Do I have to convert my C-procedure to this format? Mine is of the format void decode(char *).
UINT MyThreadProc( LPVOID pParam ) // taken from MSDN
{
CMyObject* pObject = (CMyObject*)pParam;
if (pObject == NULL ||
!pObject->IsKindOf(RUNTIME_CLASS(CMyObject)))
return 1; // if pObject is not valid
// do something with 'pObject'
return 0; // thread completed successfully
}
Next will be to begin the thread:
pNewObject = new CMyObject;
AfxBeginThread(MyThreadProc, pNewObject);
Where do I put my C-procedure in the above code?
How do I know that the thread has ended?
Thank you.
searcher08
|
|
|
|
|
Any function that starts with Afx is part of MFC. You can write threaded code without using MFC, and therefore without this format.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|