|
huh?
The reason I asked the question:
I have these objects -- with entrypoints....
They affect UI and work much better when called from a UI thread -- threads with a message queue attached.
I just wanted to put some assertions in to make sure the API's were used correctly.
I'll take a look at IsGUIThread
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
FYI
In VS 2008, the threads window now has a category column that shows the main thread, worker threads, UI threads, and RPC threads.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hello,
I wanted to create a new table in access through a code in VC++.
Can I use CRecordSet to create a new table in access?
Prithaa
|
|
|
|
|
You can use CDatabase for this. Also, Google for "CREATE TABLE."
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I just wanted to know that when we a make a dialog based application where are dialogs saved on disk as we have bmps saved in our res folder.
Thanks in advance
|
|
|
|
|
Do you mean dialog creation ?
Please refer here[^] for more information.
Regards,
Paresh.
|
|
|
|
|
Dialogs are on the RC files.Is this your answer?
|
|
|
|
|
Actually i m asking this thing because i have a dialog based application in a disk, when i copy same application on to another disk, size remains same but i am unable to get my dialog box in my newly copied application. I have opened resource file also, but definations are also not available there. Now i dont know how to get my previous dialog boxes.
|
|
|
|
|
neha.agarwal27 wrote: Actually i m asking this thing because i have a dialog based application in a disk, when i copy same application on to another disk, size remains same but i am unable to get my dialog box in my newly copied application. I have opened resource file also, but definations are also not available there. Now i dont know how to get my previous dialog boxes.
???
I am not able to understand your problem. Could you please mention your problem more clearly ?
Regards,
Paresh.
|
|
|
|
|
neha.agarwal27 wrote: when i copy same application on to another disk
u mean u copied the source code or the built output?
Thanks,
Anand.
|
|
|
|
|
|
When we create any dialog, when we use some controls on that dialog the implementation for that dialog is inside our MFC DLLs, also if we have some custom controls then implementation for it is in that particular DLLs, as the dialog is not external dependancy (unlike BMPs), it is inside the application itself, and the information related to that dialog is given in resource file, using Resource file information the compiler takes the corresponding resources and renders dialog accordingly. Wht you must have missed is to copy the resouce file properly. Copy it again and compile it .. Hopefully it should work then.
Thanks,
Anand.
|
|
|
|
|
No it is not working properly. i have tried copying it again but still the same problm is there.
|
|
|
|
|
Try recompiling the code again.
Regards,
Paresh.
|
|
|
|
|
neha.agarwal27 wrote: No it is not working properly
Then there must be some specifice problem to your project, ideally it should work.
Thanks,
Anand.
|
|
|
|
|
neha.agarwal27 wrote: when i copy same application on to another disk...
How?
neha.agarwal27 wrote: ...size remains same...
Of what?
neha.agarwal27 wrote: ...i am unable to get my dialog box in my newly copied application.
What do you mean by "get my dialog box?"
neha.agarwal27 wrote: I have opened resource file also, but definations are also not available there.
Definations? Can you open the copied .rc file and locate the dialog templates? If not, can you do so with the original .rc file?
Is the dialog created at design-time or at run-time?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dialog templates are stored in the project's .rc file. After compiling, they are in a .res file along with all the other resources (e.g., bitmaps, menus, icons).
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello everyone,
I am wondering how to set DLL property (when we select the DLL and using right click to choose properties), like version, language, company, etc.?
Do we need to write some code or just need to configure something in Visual Studio 2005?
thanks in advance,
George
|
|
|
|
|
Hi.
if you use ATL you can uses source editor. In source editor you could see version folder. double click it.......
holp it's helpful for you.
|
|
|
|
|
Hi chnuser,
I am not using ATL. But I can find a related resource to edit such properties in resource view. Thanks!
regards,
George
|
|
|
|
|
Take the resource view on the visual studio. right click on the project, select add->Resource. A dialog box will appear in that select Version and press new. You are done!
|
|
|
|
|
Thanks nave,
It works!
regards,
George
|
|
|
|
|
In SDI struct.I just want to create a toolbar in myFrameWnd(not in CMainFrame) .Xp OS ,everything is ok .but win2000 OS CreateView(&ccontext, AFX_IDW_PANE_FIRST) returns NULL. Why?
1. i wrote a class like this:
------------------------.h file---------------------------------------------
class CViewCgMap;
class CFrameWndCgMap : public CFrameWnd
{
DECLARE_DYNCREATE(CFrameWndCgMap)
protected:
CFrameWndCgMap();
virtual ~CFrameWndCgMap();
protected:
CXTPDockingPaneManager m_paneManager;
CDlgAttrib *m_pdlgAttrib;
CViewCgMap *m_pNewView;
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnNcPaint();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
-----------------------------.cpp file-----------------------
#include "ViewCgMap.h"
// CFrameWndCgMap
IMPLEMENT_DYNCREATE(CFrameWndCgMap, CFrameWnd)
CFrameWndCgMap::CFrameWndCgMap() : m_pdlgAttrib(NULL), m_pNewView(0), m_pDoc(0)
{
}
CFrameWndCgMap::~CFrameWndCgMap()
{
}
BEGIN_MESSAGE_MAP(CFrameWndCgMap, CFrameWnd)
ON_WM_CREATE()
ON_WM_NCPAINT()
END_MESSAGE_MAP()
// CFrameWndCgMap
#ifdef _DEBUG
void CFrameWndCgMap::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CFrameWndCgMap::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
int CFrameWndCgMap::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
//
CCreateContext ccontext;
ccontext.m_pNewViewClass = RUNTIME_CLASS(CViewCgMap);
ccontext.m_pCurrentDoc = NULL;
ccontext.m_pNewDocTemplate = *NULL;
ccontext.m_pLastView = NULL;
ccontext.m_pCurrentFrame = this;
m_pNewView = STATIC_DOWNCAST(CViewCgMap, CFrameWnd::CreateView(&ccontext, AFX_IDW_PANE_FIRST)); // WHY THIS CODE RETURNS NULL in win2000 OS?
if (!m_pNewView)
{
MessageBox("can't create view");
//return -1;
}
else
{
AFX_IDW_PANE_FIRST, &ccontext);
m_pNewView->OnInitialUpdate();
SetActiveView(m_pNewView);
m_pNewView->ShowWindow(SW_SHOW);
RecalcLayout();
}
//
if (!InitCommandBars())
{
return -1; // fail to create
}
CXTPCommandBars* pCommandBars = GetCommandBars();
// LOADTOOLBAR
CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Map"), xtpBarBottom);
if (!pCommandBar ||
!pCommandBar->LoadToolBar(IDR_TOOLBAR_MAP))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
// LOAD TOOLBAR
CXTPToolBar* pExtendedBar = (CXTPToolBar*)pCommandBars->Add(_T("Edit"), xtpBarBottom);
if (!pExtendedBar ||
!pExtendedBar->LoadToolBar(IDR_TOOLBAR_MAP_EDIT))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
DockRightOf(pExtendedBar, pCommandBar);
// Initialize the docking pane manager and set the
// initial them for the docking panes. Do this only after all
// control bars objects have been created and docked.
m_paneManager.InstallDockingPanes(this);
m_paneManager.SetTheme(xtpPaneThemeOffice);
// Create docking panes.
CXTPDockingPane* pwndPane1 = m_paneManager.CreatePane(
IDR_PANE_ATTRIB, CRect(0, 0,200, 120), dockBottomOf);
//pwndPane1->SetOptions(xtpPaneNoCloseable);
m_paneManager.SetTheme(xtpPaneThemeOffice2003);
return 0;
}
void CFrameWndCgMap::OnNcPaint()
{
CFrameWnd::OnNcPaint();
CWnd *pWnd = AfxGetMainWnd();
if (pWnd)
{
pWnd->SendMessage(WM_SIZE);
}
}
---------------------------view class------------------
class CViewCgMap : public CView
{
DECLARE_DYNCREATE(CViewCgMap)
protected:
CViewCgMap(); //
virtual ~CViewCgMap();
public:
public:
virtual void OnDraw(CDC* pDC); //
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnBtnZoomin();
};
Help Help............................krying.
|
|
|
|
|
Hi all,
I am getting this error when I try to retrieve an attachment property here is my code:
hrProperty = HrGetOneProp((LPMAPIPROP)m_Attachment, PropertyID, &lpPropValue);
if (hrProperty == S_OK)
{
int len = WideCharToMultiByte(codePage , 0, (const wchar_t *)lpPropValue[0].Value.lpszW, -1,0, 0, NULL, NULL );
LPSTR pTemp;
MAPIAllocateBuffer(len,(LPVOID *)&pTemp);
WideCharToMultiByte(codePage , 0, (const wchar_t *)lpPropValue[0].Value.lpszW, -1,pTemp, len, NULL, NULL );
pRetVal = pTemp;
MAPIFreeBuffer(pTemp);
return (pRetVal);
}
When it passes the HrGetOneProp I am getting Access violation writing location 0x10161b7c. and it is pointed here:
AutoMapiPtr<SPropValue> m_PropertyCache;
protected:
PropertyMap m_Properties;
Attachment(AutoMapiPtr<SPropValue>& PropertyCache, PropertyMap &Properties) :
m_PropertyCache(PropertyCache), m_Properties(Properties)
{
}
public:
virtual ~Attachment()
{
}
virtual void SaveToFile(const wchar_t* FileName) = 0;
FoundProperty FindProperty(ULONG PropTag)
{
return m_Properties.find(PropTag);
}
virtual std::wstring Type() = 0;
};
at the
virtual ~Attachment()
{
}
I am not sure why as I know the property I search for exists.
Thanks I hope you can help me resolve this issue,
Jj
|
|
|
|
|
Just a quick question about enums in C++. I have an enum where each member corresponds to an I/O bit, e.g.
enum t_MyEnum {<br />
my_IO_1,<br />
my_IO_2,<br />
my_IO_3<br />
};
My question is, is there any way I can not include my_IO_2 in the enum? For example if a flag (global variable) is set, my_IO_2 is not a part of the IO memory map.
I know I can use #ifdef to not include it at compile time but any clever solutions to doing so at run time?
Thanks in advance!
|
|
|
|
|