|
verify that you have called AfxOleInit() in your InitInstance() code - this is the typical place to put it
|
|
|
|
|
Is called. The application is MFC supporting automation.
rechi
|
|
|
|
|
can anyone tell me how to print on a paper from the user selected tray.
let say.. user enter tray 1, and click on print button, data will be printed on the paper from tray 1 . how can i set that..
i use Devmode for setting paper size. but now i want to use whatever paper size from tray 1.
how can i do that?
what is dmDefaultSource in devmode structure.
thanks
|
|
|
|
|
Is there a trick to using the progress control? When I add it using the resource editor...my dialog simply X|s.
Thanks...
ed
Someday we'll look back on this moment and plow into a parked car.
Evan Davis
|
|
|
|
|
|
|
has anyone written a control that does graph layout like GraphViz does only renders the graph to a control - would be nice if you can click on nodes, collapse them etc.
Needs to be free with source ( Yes I know about Tom Sawyer graph stuff)
Thanks
|
|
|
|
|
I have used the win32 string manipulation routines before, but they still puzzle me somewhat. For example;
char output[255] = "String";
int size = strlen(output);
strlen takes in a pointer to a char. Why then, am I allowed to send it a char array directly? Why does it treat a char array as a pointer to a char?
Simon
I need your clothes, your boots, and your copy of VS.NET.
Sonork ID 100.10024
C++ : The slag of all languages
|
|
|
|
|
Simon Walton wrote:
Why does it treat a char array as a pointer to a char
because, in C, an array is equivalent to a pointer.
char *p = new char[100];
char q[100];
p and q can be usd in the exact same ways.
p[50] = q[50] = 10;
the only differnece is that you need to clean up p when you're done.
-c
Cheap oil. It's worth it!
|
|
|
|
|
I've always suspected this. It's quite strange really. I mean, it's just a block of bytes one after another, why give it special status?
Simon
I need your clothes, your boots, and your copy of VS.NET.
Sonork ID 100.10024
C++ : The slag of all languages
|
|
|
|
|
I have a COM object that starts Microsoft Word and opens a word document. The user can make any modifications to the docunment. I added a special button that is going to be used to save the document and exit Microsoft Word. Unfortunately, I am not sure how to capture the event to know the button has been hit. I have looked through the posts and articles and there is a lot of information if you are an ATL server. But this is an MFC-based COM object and is not an ATL server. Does anyone know what do I need to do, in plain english, to determine when my button has been hit. Am I going to have to make it an ATL server to get the event and if so, how do I do that?
PLEASE HELP!!!!!
|
|
|
|
|
Is it me or is the latest implementation of the _bstr_t class flawed in Visual Studio .NET?
I have a class that has an internal member of type _bstr_t. During construction the _bstr_t classes default constructor runs and sets it's internal m_Data pointer to NULL.
Later i call a function with a BSTR parameter and use the _bstr_t::Assign method to copy the BSTR into my member variable. Under VS6 this code was fine but under VS.NET it crashes.
The reason for the crash is in an ASSERT where the expression is something like (m_Data->GetWString() != s) since m_Data is NULL it crashes! Since it's in an assertion i can compile to a release build and it works ok.
Has anyone else seen this and is there any kind of service pack for VS.NET that fixes the problem?
|
|
|
|
|
I wan to release the memory in CList associated with the element at the head position after reading it. will the RemoveHead() does that? If so, in my application, after reading from the CList, memory usage is not reduced. How to go about it.
Here is the code for reading the CList
void CPLayerApp::ReadFromList()
{
unsigned char data[10],mCnt,mMid;
CMessage* pMess;
CSingleLock singleLock(&m_SyncLock.m_mutex);
CString str="";
while(1)
{
if(m_messList.GetCount() != 0)
{
singleLock.Lock();
pMess = &m_messList.GetAt(m_messList.GetHeadPosition());
mCnt = pMess->m_cnt;
mMid = pMess->m_mid;
pMess->GetData(data);
POSITION pos = m_messList.GetHeadPosition();
m_messList.RemoveHead();
singleLock.Unlock();
if(data[0] == 0x10)
{
str.Format("%0x",data[0]);
AfxMessageBox(str);
break;
}
}
Sleep(200);
}
}
UINT WriteToListThread(LPVOID pParam)
{
CPLayerApp* pPLayerApp = (CPLayerApp*)pParam;
CMessage* pMsg = new CMessage();// = pPLayerApp->m_message;
CMsgList* m_messList = &pPLayerApp->m_messList;
CSyncLock* pSynLock = &pPLayerApp->m_SyncLock;
CSingleLock singleLock(&pSynLock->m_mutex);
unsigned char cnt=3;
unsigned char mid=2;
unsigned char data[14];
data[0]=0x04;
bool bWrite=TRUE;
while(1)
{
if(bWrite)
{
singleLock.Lock();
pMsg->SetValues(cnt,mid,data);
m_messList->AddTail(*pMsg);
singleLock.Unlock();
data[0] += 1;
if(data[0]==0x11)
{
AfxMessageBox("Test");
bWrite=FALSE;
}
}
Sleep(500);
}
return 0;
}
Rsh
|
|
|
|
|
Hi, I create a Win32 dialog (as usual with RegisterClass() + CreateWindowEx() etc).
The dialog itself shows an icon, but when I press ALT+Tab I see no icon. Anything I missed? Thx for help!
|
|
|
|
|
Anonymous wrote:
The dialog itself shows an icon, but when I press ALT+Tab I see no icon. Anything I missed?
Nope, this is "By Design". A firetruckin' stupid design if you ask me (and I've only heard similar negative statements re. this, never one nice word about it).
|
|
|
|
|
Mike Nordell wrote:
Nope, this is "By Design".
there is nothing I can do against? Hmm, like handling a message...?
|
|
|
|
|
I needed to set the icon for the parent window, a MFC frame window which creates all other (MFC or WIn32 dialogs). Once the icon for the parent is set all child dialogs are shown with this icon in the ALT-TAB list.
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1
SetIcon(AfxGetApp()->LoadIcon(IDR_ICON_DEFAULT), TRUE);
}
|
|
|
|
|
PS: Needless to say WinAPI can drive you crazy sometimes
|
|
|
|
|
Hi, when I'm changing Windows colors, my ownerdraw buttons (CBtnST)do not handle this. Which message do I need to handle? Thx for help.
|
|
|
|
|
Have you looked into the:
WM_SYSCOLORCHANGE
WM_SETTINGCHANGE
WM_WININICHANGE
Messages? They should be a good starting point...
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
Anonymous wrote:
my ownerdraw buttons (CBtnST)do not handle this.
Here is the patch
void CButtonST::OnSysColorChange()
{
CButton::OnSysColorChange();
SetDefaultColors(TRUE);
m_dcBk.DeleteDC();
m_bmpBk.DeleteObject();
}
|
|
|
|
|
Is there a way to create a CMDIFrameWnd in a CMDIChildWnd view.
My firts idea was to create a CFormView with a static control an then create a new CMDIFrameWnd on this (static) CWnd.
Second idea was to create the CMDIFrameWnd directly while creating the (CMDIChildWnd) view.
I can't find in the documentation if you can have more than one CMdiFrameWnd in an app without causing some kind of problem. But I also can't find that you can't do this anywhere.
Any help would be greatly appreciated.
Samplecode also.....
Thorsten Koch
BTW: I don't want splitter windows
_________________________________________
"If Microsoft ever does applications for
Linux, it means I've won."
- Torvalds, creator of Linux OS -
|
|
|
|
|
I desperately need a grid control that I need to use to dsplay data..I have no use to bind it to a data contorl or the likes...I need to display content from the serial port in the grid...
the problms is that I need to resize the grid depending upon the incoming data. so I need to dynamically change no of rows and cols and I want to resize the size of the grid to the exact size of rows adn cols....
since, valued such as GetColWidth() and GetGridLineWidh() are in twips, I need some way to converte them to pixels in VC...
can some1 tell me how I get the current scale of Twips-Pixels (using either GetDeviceCaps() or GetSystemMetircs() )
in VC++?
thks
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
|
Hello Friends
Hi ! there,,,need some help,,i hope someone will comeforward,,,
This is stupid question i know but still i want to know where i am wrong.
I have a SDI application with map displaying on that having some symbols,,,and a dialog box where uneditable related information is displayed,,,
Whenever i move the Dialog box in the Background the Map is getting effected i.e i have few symbols which are disappearing randomly,,,
I tried to fix the bug ,initially by WM_MOVE method for that dialog.,,but the problem is that it is not at all displaying any changes,,i tried first for a mere message box,,but stil it is not working,
Can any one ple solve this,,
Thanks in advance
Bye
Thanks & Regards
Neonave
|
|
|
|