|
Ravi Sankar S wrote:
m_HeaderCtrl.GetItem(nSubItem, &hditem);
In the GetItem the m_hWnd is NULL so code in AFXCMN.INL gives Access Violation
Check how m_HeaderCtrl is initialized. The m_hWnd in GetItem is the one from m_HeaderCtrl, which does seem to be an initialized object in your case.
Ravi Sankar S wrote:
Since ASSERT won't execute in Release mode it is working fine in Release mode.
I would not rely on such a statement. If it fails in Debug, it does not work either in Release, it is only that the problem does not assert immediately (the effects of what goes wrong does not show immediately). But it can bring unexpected (and sometimes unrelated) errors later for the program user ... So better be sure to find what goes wrong.
~RaGE();
|
|
|
|
|
How can I verify that an item i write is not member of data list ?
I studie my self
|
|
|
|
|
CCOmboBox* pCB = (CComboBox*)GetDlgItem(IDC_MY_COMBOBOX);
CString strSomeText = <font color=gray>"Hello World !!!"</font>;
<font color=blue>if</font> (m_pCB->FindStringExact(-1, strSomeText) == CB_ERR) {
<font color=green>
m_pCB->AddString(strSomeText);
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Friends,
My process is running and it is loading DLLs, calling functions exposed by DLL, unloads DLL if it is loaded dynamically. Ofcourse my program also uses static DLLs and calls functions inside it.
I want to know during the course of the execution of my process that which DLL is loaded by it and which function inside the DLL the process is calling.
How can i do so ? Is it possible with VC++ debugger, or some tool ?
Of course it is easy to find that which DLL is loaded by my process. The problem is to find that which function inside that DLL the process is calling ?
Imtiaz
|
|
|
|
|
You can use DepencyWalker (a tool that is provided with visual Studio) to check which dll's your program needs. But you cannot see which functions will be used. And of course, this is not for dll's that are loaded explicitely (using the LoadLibrary and GetProcAdress functions).
In your question, what do you mean by 'real time' ??
|
|
|
|
|
No, not dependency walker.
Actually i want to know during the course of the execution of my program that which DLL is loading and which function inside the DLL is being called by my process.
Imtiaz
|
|
|
|
|
|
Do you mean 'real time' or 'run time'. I DO KNOW that people get the two terms confused.
If you indeed meant RUN TIME, then attach to your program with the debugger and single step through it. You can also write a hooking routine to catch LoadLibrary calls, which will alert you to another DLL being loaded. With a DLL loadded, it will consume a certain range of memory. Watch for the CPU instruction pointer to go into that range of memory - a clue that the DLL's code is being executed. Needless to say, DllMain will have to be called within the DLL, but you can probably filter that one out. You cna probably use DumpBin to get the offset addresses of the functions wihtin the DLL. If you could map those against its load address, then you would know which addresses more specifically relate to which functions within the DLL.
|
|
|
|
|
the latest version of depends.exe also shows dynamically loaded dlls.
The functions used from each dlll are listed in the top right window, the functions available in each dll are listed in the bottom right window.
Nunc est bibendum!
|
|
|
|
|
You will need to maintain a list each time you call load library and get proc address.
You could dump this list periodically.
Nunc est bibendum!
|
|
|
|
|
hi
i want 2 use unicode in my project. i don know where should i add #define _UNICODE
and also i cant write persian in the vc++ 6 environment.
for example i want to set a waindow title to sth(not english)with SetWindowText() but i cant write anything except english in vc++6 editor.
for example SetWindowText(_T("سلام")) but it just write nonesense characters.
|
|
|
|
|
hamidreza_buddy wrote:
i don know where should i add #define _UNICODE
inside stdafx.h , at the beginning (before the includes).
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
hi toxcct
thx . what about my other question
my compiler is Microsoft Visual c++ and as i said when i want to write sth wich is not english in my project it jus write nonesense characters. what should i do
|
|
|
|
|
i did ot answered because i don't know the answer.
but activating unicode as i told to you could - perhaps - allow you to set persian text in the edit boxes, doesn't it ?
hem, i'm thinking to something more ; did you set the edit box alignment property "right to left" ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i did some change in regional settings and it works
but i added #define UNICODE to my stdafx.h . it says:
>>cannot open file "mfc42ud.lib
here is my stdafx.h :
#define _UNICODE
#define UNICODE
#if !defined(AFX_STDAFX_H__C1E8B1B1_B28C_4E3B_B6B5_49C7878BCAC5__INCLUDED_)
#define AFX_STDAFX_H__C1E8B1B1_B28C_4E3B_B6B5_49C7878BCAC5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
what should i do??
|
|
|
|
|
what about that: SetWindowText( _T("your own characters") );
路漫漫其修远兮,吾将上下而求索。
|
|
|
|
|
You can define it either in the Project Settings - Compiler, Prepropcessor, Definitions (or a similar path), or in your stdafx.h before including other files.
BTW, make sure you define both _UNICODE and UNICODE, and that MBCS (which is defined by default) is removed.
To be able to write non-english characters, in the Control Panel - Regional Settings - Advanced Tab, set the "Language for non-Unicode programas" to the one you want.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
hamidreza_buddy wrote:
i don know where should i add #define _UNICODE
Get into the habit now of defining both UNICODE and _UNICODE . Put them in stdafx.h before any other #include directive.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
i have made a dialog based project......it has two dialog boxes.....in the second dialog box i have added a listbox.....i m using AddString() function to add items in it ...but these items are not being displayed on screen..........my code look like
BOOL dialog::OnInitDialog()
{
m_listbox.AddString("hello");
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
can anybody help me???????????plz
|
|
|
|
|
|
yeah...........i have initilized it using class wizard........firstly i created a dialog based application with single dialog box and applied the same code.....it worked alright.....now i have two dialog boxes.....i used Domodal()to call the 2nd dialog box containing the list box.....but now its displaying nothing.....
|
|
|
|
|
do you amalgam the two OnInitDialog() function ?
each dialog box have its own...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
no.......i have two oninitdialog() one for each dialogbox
|
|
|
|
|
and how are your listboxes initialized ?
(some code would be well appreciated)
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well................i made a list box....then added a member variable to it.....and then i gave code i have already displayed in oninitdialog definition
|
|
|
|