|
I would like to move my project (well 3 projects in one solution 2 are Client and Server) from Windows Visual Studio .Net to a GNU C++ environment on a Unix platform.
Are they any way of generating a make file to build the code on the Unix system. I know only a little about Make files.
I know I need to get rid of all the Windows only stuff out of the code.
Any suggestions please.
Andy.
|
|
|
|
|
VS6 has an Export Makefile option. Surely VS200x has a similar option.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The Export Makefile appears to have been dropped in Visual Studio 2005.
All I can find is reference to VS 6.0 and this facility.
But surely they must be a method to generate a make file within VS .Net
Andy.
|
|
|
|
|
Hi I am reading all the emails and having problem identifying the type of the email.
I use MAPIFolderPtr and browse all the email items.
I used UnManaged C++
MAPIFolderPtr MFolder
_ItemsPtr mItems;
_MailItemPtr mItem;
_AppointmentItemPtr aptItem;
.....
.....
mItems = MFolder->Items;
for(int index=1;index<mitems->Count;index++)
{
if (MFolder->DefaultItemType == olMailItem)
{
mItem = mItems->Item(x);
....
}
else if (MFolder->DefaultItemType == olAppointmentItem)
{
aptItem = mItems->Item(x);
...
}
....
}
However MFolder->DefaultItemType is always returning olMailItem.
I also used MFolder->DefaultMessageClass(), etc. but Dont' know how to find out what type of item it is. How can I find out itemType so I can get the right mail item?
Thanks.
|
|
|
|
|
I found this link
http://vb-helper.com/howto_copy_all_browser_text.html
I tried to imitate the function DoEvents as so
<br />
void DoEvents(int milisec=5)<br />
{<br />
MSG msg;<br />
DWORD dwStart=GetTickCount();<br />
while (true)<br />
{<br />
if(GetTickCount()-dwStart>milisec)return;<br />
if(!PreTranslateMessage(&msg))<br />
{<br />
::TranslateMessage(&msg);<br />
::DispatchMessage(&msg);<br />
}<br />
}<br />
}<br />
But when I call the functions - it's not working...
How do I do it in C++
Thanks in advance
|
|
|
|
|
The good news is you posted this in the correct forum. The bad news is you don't have the first idea what you are doing.
Good luck, you're going to need it.
led mike
|
|
|
|
|
What in the world does this code snippet have to with this thread's subject?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yytg wrote: I tried to imitate the function DoEvents
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
yytg wrote: I tried to imitate the function DoEvents as so
yytg wrote: But when I call the functions - it's not working...
How do I do it in C++
I've had a need to implement DoEvents in C++ myself, and wrote something that works. Here is what I came up with.
namespace
{
void DoEventsPumpMessage()
{
CWinThread *pThread = AfxGetThread();
if( !pThread->PumpMessage() )
{
int nResult = (int)AfxGetCurrentMessage()->wParam;
::PostQuitMessage(nResult);
TRACE("DoEvents Received quit message\n");
CQuitMessageException::Throw();
}
}
}
void DoEvents( bool bAtLeastOne )
{
if( bAtLeastOne )
{
DoEventsPumpMessage();
}
MSG message;
while( ::PeekMessage( &message, NULL, 0, 0, PM_NOREMOVE ) )
{
DoEventsPumpMessage();
}
}
Many message loops I've seen just assume there won't be a quit message, but in my case, I really wanted to avoid runaway background threads.
Nathan
|
|
|
|
|
I'm using Visual C++ 6.0. to create a MFC win32 .exe SDI application. I would like to display my own string in the title location of the Window that gets displayed when the program is run. I only need to do this one time so setting things during compile is fine. I tried changing the main frame caption parameter during the Visual C++ setup of the workspace. That string then appeared as the caption, but it was preceded by the word "Untitled". How do I remove the word "Untitled" so that only the string I want is displayed. I'm a C programmer who has somewhat migrated to C++ (not by choice). Thanks!
|
|
|
|
|
Kwanalouie wrote: How do I remove the word "Untitled" so that only the string I want is displayed.
In the frame's PreCreateWindow() method, remove the FWS_ADDTOTITLE style.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the quick replies but I'm a little slow.
When I search for the PreCreateWindow Method I find the following code:
BOOL CTestProgramView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CScrollView::PreCreateWindow(cs);
}
However, I cannot locate where CREATESTRUCT ... is located, so the comment about removing FWS_ADDTOTTITLE style is somewhat cryptic to my level of skill. How do I removed FWS_ADDTOTITILE? Where in the world is that located?
Thanks
|
|
|
|
|
Kwanalouie wrote: However, I cannot locate where CREATESTRUCT ... is located...
It's passed as a parameter to PreCreateWindow() .
Kwanalouie wrote: ...so the comment about removing FWS_ADDTOTTITLE style is somewhat cryptic to my level of skill. How do I removed FWS_ADDTOTITILE? Where in the world is that located?
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks again, but did I mention that Forrest Gump was the top student in my programming class? I looked up the Visual C++ help, and modified my test code to the following:
BOOL CTestCodeView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_OVERLAPPEDWINDOW;
return CView::PreCreateWindow(cs);
}
This compiles and links but when I go to run the code, it results in a
"Debug Assertion Error" in line 65 of viewcore.cpp. When the line cs.style = ... is commented out, it runs (but of course my title for the window isn't displayed).
Thanks
|
|
|
|
|
I found out there were two different PreCreateWindows calls. When I put the code in the following it worked like I wanted it to, but I don't understand the difference between these two calls:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style = WS_OVERLAPPEDWINDOW;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
and the other one:
BOOL CTestProgramView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
// cs.dwExStyle = WS_OVERLAPPEDWINDOW;
// cs.style = WS_OVERLAPPEDWINDOW;
return CView::PreCreateWindow(cs);
}
Thanks!
|
|
|
|
|
Kwanalouie wrote: cs.style = WS_OVERLAPPEDWINDOW;
This simply replaces whatever value cs.style had (before PreCreateWindow() was called) with WS_OVERLAPPEDWINDOW . To remove the style, use:
cs.style &= ~FWS_ADDTOTITLE;
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
In PreCreateWindow add (sorry that's remove) FWS_ADDTOTITLE to the window styles
led mike
|
|
|
|
|
Hi,
I am using MSHFlexGrid in my application(VC6).
To edit any particular cell I want to float an edit box in front of the cell.
Please help me how to float the edit box?
Thanks in advance.
Sunil.
|
|
|
|
|
Like this:
CEditWnd *pBox;
CSldFlexGrid objMyGrid;
long lHeight;
long lWidth;
long lCol;
long lRow;
int nY = objMyGrid.GetRowPos(lRow);
int nH = objMyGrid.GetRowHeight(lRow);
int nXBt = objMyGrid.GetColPos(lCol);
int nWBt = objMyGrid.GetColWidth(lCol,0);
CRect NewListRect(nXBt, nY, nXBt+nWBt, nY+nH);
pBox->MoveWindow(NewListRect);
pBox->ShowWindow(SW_SHOW);
pBox->SetFocus();
I hope that helps.
modified on Thursday, April 17, 2008 11:00 AM
|
|
|
|
|
I am using CPropertySheet class. In this for removing 'Apply' button
on propertysheet someone i.e. my senior written following code. But I
can't mean it.
AFX_OLDPROPSHEETHEADER* psh = dlg.GetPropSheetHeader();
psh->dwFlags |= PSH_NOAPPLYNOW;
psh->dwFlags &= ~PSH_HASHELP;
Plz explain me this code. Means what AFX_OLDPROPSHEETHEADER and
GetPropSheetHeader() does?
|
|
|
|
|
Nikesh Jagtap wrote: my senior written following code. But I
can't mean it.
Why not asking him?
|
|
|
|
|
|
I'm working on a project that involves converting an application developed 10 years ago using VC++ 4.2 running on Windows NT 3.51 to VC++ 2005 running on Windows XP. Suffice it to say this has been a nightmare. The conversion "wizard" seems to leave most of the work undone. After much travail, I've finally winnowed the errors down to one. I've detailed it here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3188024&SiteID=1&mode=1[^]) on the MSDN C++ forum. Thus far I've gotten no satisfactory answer.
It seems to me that there should be some other people who have had to convert old Microsoft C++ applications developed with 4.2 to C++ 2005 and have encountered similar problems. I assume this is probably some weird Microsoft quirk that can be easily solved by someone in the know. Since this is idiomatic and has nothing to do with logic or programming in any direct way, it requires someone who really knows all of the in's and out's of Visual Studio.
This project is for the U.S. Navy and is high priority so any help will be greatly appreciated.
"I would give the Devil benefit of law for my own safety's sake." - from A MAN FOR ALL SEASONS, by Robert Bolt
|
|
|
|
|
From what I understand, it's a problem with conflicting resource IDs.
use this : http://www.riverblade.co.uk/products/resorg/[^] (from our own Anna-Jayne) to try to see what can be (semi-)automatically done to your resources.
If that does not work, check the resource "includes" to see if there's no unwanted include directive there.
If that does not work either, do it manually, check each resources, each values.
Good luck.
|
|
|
|
|
Maximilien wrote: From what I understand, it's a problem with conflicting resource IDs.
use this : http://www.riverblade.co.uk/products/resorg/[^] (from our own Anna-Jayne) to try to see what can be (semi-)automatically done to your resources.
If that does not work, check the resource "includes" to see if there's no unwanted include directive there.
If that does not work either, do it manually, check each resources, each values.
Good luck.
I downloaded/installed the suggested Riverblade tool and ran. It found quite a few potential conflicts which I fixed.
Unfortunately, it didn't solve my problem. I still get the CVT1100 error. And, when I change the /TLBID value from 1 (suggested by Microsoft help) the error stays the same: "type ICON, name: 1". In other words, no matter what value I insert (I tried 2, 1000, and 39000) I still get name: 1.
As for "no unwanted include directive", I assume you mean an extraneous include file? If not, what do you mean? I did remove what I determined was dead code that caused a compiler error because it had 3 ID's that were not defined anywhere. Apparently, the 4.2 compiler didn't flag this dead code because it was smart enough to determine that it was, in fact, dead and didn't generate any related object. Ergo, there was no reason to flag the error. VC++ 2005 is much less forgiving. Other than that, I haven't found any obvious dead code.
"I would give the Devil benefit of law for my own safety's sake." - from A MAN FOR ALL SEASONS, by Robert Bolt
|
|
|
|