|
I did find a built .exe for windows for the gcc compiler, but now need to find out how to build a dll with a .c and a .def file......any one have any info on this? Dont see it in the docs....
Appreciate your help,
ns
|
|
|
|
|
I've never done it but there are a lot of people doing Windows development using Cygwin. You need a module called mingw32.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
Awasu v0.4a[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
There used to be a compiler called DJGPP that was good for C stuffs. It might be free or shareware too.
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
You may consider taking another route: scripting! If you write your source code in VBScript (or JavaScript), you can then use Microsoft's scripting engine to run the code from your main program. Since it's in VBScript, the user will probably be able to modify the code more easily and they won't have to worry about recompiling it, since your main program will interpret it a run-time.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Hmmm...have to look into this. Sounds promising...I have to get the background on this. Thanks for the pointer...
Appreciate your help,
ns
|
|
|
|
|
|
|
Here are a couple of C scripting things you could embed:
ICI[^]
TCC[^]
CINT[^]
CSL[^]
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
Terrific. I've been checking out the scripting idea....hopefully the guy who wants this done will be agreeable to the notion. MAny thanks for all the leads.
Appreciate your help,
ns
|
|
|
|
|
I'm currently working with an MDI application and RogueWave's Stingray library. I'm using their SECControlBar class for a dockable window which will contain 2 tree controls selectable by tabs. I have the trees working and the tabs working, but I'm trying to keep all my data in the Document class of my MDI. This SECControlBar class is not doc/view based, it's just a CWnd derivative. My question is how do i get access to my document class via this CWnd derived dockable window? Normally i just use a GetDocument for my view classes to obtain the related document but there is no such function i can see for the same thing from this CWnd derivative.
Thanks for you time.
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
Look for GetActiveView ( from CFrameWnd ) call this on the MainFrame ( AfxGetMainWnd ), and with the view, you GetDocument.
Max.
|
|
|
|
|
I attempted your suggestion with this code:
void ModuleTab::OnModulemenuAddchannel()
{
// TODO: Add your command handler code here
CString display;
int work;
AfxMessageBox(_T("add channel. later."));
//start
CFrameWnd* pMWnd;
pMWnd=(CFrameWnd *)AfxGetMainWnd();
CView* pVWnd;
pVWnd=pMWnd->GetActiveView();
CGENyDoc* pDoc;
pDoc=(CGENyDoc *)pVWnd->GetDocument();//fails debug assertion here.
//end
work=pDoc->m_myint;
work++;
pDoc->m_myint=work;
display.Format(_T(" value: %d"),work);
AfxMessageBox(display);
Invalidate();
}
It fails where i call get document. It appears that I'm getting the wrong pointer.
Any suggestions?
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
I'm sorry, I was too fast to answer : The view is inside a frame window.
I do this to get the view:
CMainFrame *pMainFrame = ( CMainFrame* )AfxGetMainWnd();
ASSERT( pMainFrame );
CMDIChildWnd *pChild = (CMDIChildWnd *) pMainFrame->GetActiveFrame();
CView* pView = pChild->GetActiveView();
Max.
|
|
|
|
|
Great!! works good thanks
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
What's the easiest way to play a sound. Does VS have a function that will do this?
|
|
|
|
|
Try the PlaySound(...) API function!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
I am designing a program that acts as a countdown timer. However, because the function called from the GUI doesn't stop running until the time has decremented to zero, the GUI can't show how much time is remaining. Here's the source:
void CtimerDlg::OnBnClickedStart()
{
int currentTime = 0;
int timeInSeconds = 0;
char min[5] = "";
char sec[5] = "";
char setTime[12] = "";
UpdateData(true);
currentTime = time(NULL);
minutesRemaining = setMinutes;
secondsRemaining = setSeconds;
sprintf(min, "%i", setMinutes);
sprintf(sec, "%i", setSeconds);
strcpy(setTime, min);
strcat(setTime, " : ");
strcat(setTime, sec);
startTime = setTime;
timeInSeconds = ((setMinutes * 60) + setSeconds);
while(timeInSeconds != 0)
{
if(currentTime != time(NULL))
{
if(secondsRemaining == 0)
secondsRemaining = 60;
timeInSeconds--;
secondsRemaining--;
sprintf(sec, "%i", secondsRemaining);
secLeft.SetWindowText(sec);
currentTime = time(NULL);
}
if(secondsRemaining == 59)
{
minutesRemaining--;
sprintf(min, "%i", minutesRemaining);
minLeft.SetWindowText(min);
}
}
UpdateData(false);
}
// end code
How can I get the GUI to update while the progam is executing?
-Thanks
|
|
|
|
|
Maybe you should spawn a thread to countdown?
Jeff Rothenberg
Project Engineer
Vector CANtech, Inc.
|
|
|
|
|
I'd use a timer instead, then you can have a handler function that gets called every second, which will allow normal GUI operations to continue
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
There are several soltuions. One solutin is a timer queue timer that will call a callback after upon tick.
Kuphryn
|
|
|
|
|
kvan07 wrote:
How can I get the GUI to update while the progam is executing?
Pump the message queue. See my TaskTimer[^] article for instructions.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi,
I have a CTreeCtrl with a font set to 'Courier'. When I try to determine the width of a text item in the tree I do something like:
<br />
CDC* pDC = m_ctrlTree.GetDC();<br />
int nItemWidth = pDC->GetTextExtent(strItem).cx;<br />
The width I receive is smaller than the actual text width. It seems that the font of the DC ('system') is not equal to the font of the tree control ('courier').
Does anyone know how this can be?
|
|
|
|
|
Try this (I haven't tested it, but it might work):
CDC* pDC = m_ctrlTree.GetDC();
CFont *pFont=pDC->SelectFont(m_ctrlTree.GetFont());
int nItemWidth = pDC->GetTextExtent(strItem).cx;
pDC->SelectFont(pFont);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx for your reply, but the CDC does not have a SelectFont.
|
|
|
|
|
It's a typo: Substitute SelectObject for SelectFont .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|