|
|
|
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
|
|
|
|
|
Your English is a little broken so it's a bit difficult to understand your problem. If it's a drawing problem that you're having, take a look a the OnDraw method. If you want to make your window update the drawing region after a dialog (or any other window for that matter) obstructs it, OnDraw is where you should place the drawing code. If you are doing some drawing outside of the OnDraw method, that is OK, you just have to ensure that OnDraw knows the last state of the drawing area.
I'm not sure I'm on the right track here, so let me know if this sounds helpful. The "symbols" you speak of may be disappearing because you're not re-drawing them. Not sure what's going on exactly, though. Can you clarify?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi All,
The prob is as under:
I have a main app... lets name it "MainApp"... and a DLL named "PlugIn1"..
When I clck on one of the menu optins in the main app's window, DLL's InitPlugIn Function is called, where a new toolbar button is created... that is , a new button is appened, to the default toolbar of the main app...
I have mentioned the button state as TBSTATE_ENABLED, but still it is not enabled.... It appears as disabled...
I am using doc/view arch...
and VS7
also, one more prob, where to handle it's event... whether in the DLL or main app???
I have tried handling it in main app's Mainframe --->> OnCommand () handler... but no event is generated, when i click on this button... may be because it is disabled....
So my main prob is how to enable that button...
Please do help me... it's kinda urgent...
Thanks in advance,
Mohit Khanna
|
|
|
|
|
toolbar buttons will normally appear dimmed out if they do not have a message handler associated with them, so it sounds like the real problem is where to handle it, as once the event is handled the button should not be dimmed out.
make sure that you have the right ID for the button that is created, since the button is added to a toolbar that is a member of CMainFrame i would assume that the command should be in the CMainFrame's message map..
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND(ID_OPTIONS, OnOptions)
END_MESSAGE_MAP() wish i could help more.. but im a newbie..
-dz
|
|
|
|
|
Hi Dazinith,
Actually in your way you are right... Messages for the toolbar can be handled in CMainFrame class... but the actual prob is that... One or more buttons are added to the toolbar dynamically by the DLL... so the CMainframe class does not know before-hand about the buttons... also the resource ID for the button may be DLL dependent... so the ideal place to handle that button's functionality is in the DLL itself...
It may be that DLL be written by a third party who does not know about CMainFrame's code... so in that way..
the application can be very flexible... so how to do that???
till know the status is.. button is being displayed... on the toolbar...
but is disabled....
how to specify the message handler... i have tried it but it still isn't being enabled...
IS it regarding to the resources???
Please someone help me on this... it's really bugging me ...
Thanks in advance...
Mohit
|
|
|
|