|
jerry1211a wrote:
Is possible to test for the existence of int socket1 during co
Not directly, because the information you're looking for is not available at compile time, only link time. The extern int socket1 line tells the compiler "there's an int defined somewhere called socket1 " and that's all it needs. It's not until the linker comes along that the build process actually checks to see that socket1 is defined somewhere. That's why "unresolved external" errors are linker errors.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
Magnae clunes mihi placent, nec possum de hac re mentiri.
|
|
|
|
|
I'm trying to catch F6 being pressed using 'OnKeyDown', but when F6 is pressed I get nothing. Keys F1, F2, F3, F4, F5 & F7 all work (I haven't tried the other function keys yet).
It's got me scratching my head, I even changed the keyboard, but it still does nothing. Any ideas?
Thanks,
Ali
|
|
|
|
|
I recall having this problem in ED on a specific version of Windows where Windows itself grabbed F6. It may have been W2K. Just tried WXP and it is OK. Try a Google search. HTH.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for the advice, I have Googled it and no one else seems to have this problem. I am using WXP too!
I am compiling under VC++6, is that what you are using?
I'm going to try it on some other machines here, I have only tried 1 other so far, I'm wondering if it is another peice of software interfering with the keyboard int that I have installed on both machines I've tried.
(Now 'add a smiley' in CP isn't working for me either ... oh no, its going to be one of those days!)
Thanks again,
Ali
|
|
|
|
|
If I use Greta(or some STL implement) in MFC, who can give
me a code sample with backref and substitution. At least let
AfxMessageBox to show backref.
Is there some regular expression not STL implemented and free,
and full features with Perl, Henry Spencer's Regexp Engine is good but
does not support regexp like this :
.*? .+?
Thanks!
|
|
|
|
|
http://www.boost.org/
boost regex
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a semi-transparent window. I need all mouse clicks to fall through to proper windows underneath mine. I need to implement a "click-through window"
A previous suggestion was to return HTTRANSPARENT from WM_NCHITTEST. HTTRANSPARENT is usefull when you create a control and you want clickthrough to the parent (same thread). However in my case I want clicks to fall through a top level window to the underlying windows.
Does anyone have any further suggestions?
|
|
|
|
|
I am trying to create a flash movie from within an MFC (MDI) application. The movie must receive information from the program, but not necessarily send anything.
I am aware that I might need to launch IE to run the flash file, so help with that is also appreciated.
Here's what I am looking for:
1. What libraries do I need, and where to get them?
2. Perhaps a code snippet or documentation reference.
3. Code to launch IE (unless there's a way to display a flash movie in a regular MFC view).
Thanks
When the going gets tough... write a computer program to do it for you
When the going gets tough... write a computer program to do the thing for you
|
|
|
|
|
There is no need to launch Internet Explorer to display a Flash movie. Macromedia provides an ActiveX control. You don't even need any special libraries - all computer with flash player installed should have the ActiveX control available. Simple add the player to your toolbox and then add it to your dialog.
As far as I remember communicating with Flash is done via fscommand(??). Just search Macromedia for more information. I'm sure tutorial and documentation is available.
|
|
|
|
|
Hi everybody,
I'm trying to write my own installer tool at the moment.
I want to install the following components in this order:
[1] MSDE 2000
[2] MDAC 2.8
[3] .Net Framework
[4] my Application
In my code (console app) I do something like this:
1. start msdeSetup.exe (with CreateProcess(...))
2. Wait till msde is installed completely
3 start mdacSetup.exe .......
4. wait ...
5. start ...
and so on
this works quite well.
My Problem is now that I want to wait with the reboot till EVERYTHING is installed, but some of this components (e.g. msde) force a reboot by themselves.
So my Question is: How can I execute a File with CreateProcess(...) but suppress any reboot this app might perform, so I can start my own reboot when everything is installed
Thanks for your help
cu
immes
|
|
|
|
|
Are there any library functions for resolving dos file references into a list of files? For example...
"*.*" or "?hello?.*" or *1?2?3*.cpp" or "C:\windows\*.exe" or even "c:\*\fish.bmp"
Is there an easy way to get a list files refered to by these?
Joel Holdsworth
"Outlook not so good"
That magic 8-ball knows everything! I'll ask about Exchange Server next
|
|
|
|
|
something like this?
void LoadFileNamesFromDirectory(CStringArray *pFileNames, LPCSTR cpDirSpec = NULL)
{
CString cFileName;
WIN32_FIND_DATA sFD;
if (!cpDirSpec || *cpDirSpec == 0)
cpDirSpec = "*.*";
HANDLE hFind = FindFirstFile(cpDirSpec,&sFD);
if (hFind != INVALID_HANDLE_VALUE)
{
if (!(sFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
pFileNames->Add(sFD.cFileName);
while (FindNextFile(hFind,&sFD))
{
if (!(sFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
pFileNames->Add(sFD.cFileName);
}
FindClose(hFind);
}
}
onwards and upwards...
|
|
|
|
|
How can i bring MAC style to the UI of my application developed using VC++6.0.Is there any method to tweeking the code so as to optain such an interface?if any free libraries are avaliable to optain such output please do specify that to...!
Thankyou
|
|
|
|
|
|
I'm new to Visual C++ and trying to learn it. I've written a Windows program from the ground up and I'm trying to add a status bar to my dialog window but I get a compile error:
...\489window.cpp(14): error C2228: left of '.SetPaneText' must have class/struct/union type
Here's my declaration and code with the offending line at the end, the static void declaration:
<br />
public:<br />
CStatusBar m_bar;<br />
static void setStatusBarText(CString newText){ m_bar.SetPaneText(NULL, newText, true); }
I have a menu and when the user clicks "Open..." in the menu, they get the open file common control and once the file has been chosen, my program fetches two fields, a height and width of the bitmap image and it should then set the status bar to be "<width> x <height>" with the numbers filled in.
Where the program does this is in a class I derived from CWinApp, but the codeproject.com example I found places the status bar declaration in the class derived from CWnd (I derived my dialog from CFrameWnd from using another example somewhere) which is where the above code is copied from. It's acting like it doesn't know what m_bar is because I can try and retype the m_bar.Create(...) line but once I hit the period, it tells me m_bar isn't a union, class or struct, but it was declare the line above it. Any help is appreciated, but please remember I'm new and need something easier to understand than most. Thanks in advance.
more:
I just adedded the create line in the constructor for my CFrameWnd derived class and it knows m_bar. I commented out the offending line above, so I just have the declaration and the create. I ran the program and it created the status bar and it looks just fine. I still get that error above.
|
|
|
|
|
Remove the static keyword from your function prototype and it should work.
The static declaration means that your function does not exist with the instance of your class, therefore will be unaware of any member functions.
I Dream of Absolute Zero
|
|
|
|
|
I think I started out without static and then I encountered this error:
...\489window.cpp(64): error C2352: 'C489guiFrame::setStatusBarText' : illegal call of non-static member function
And here's the line for that:
C489guiFrame::setStatusBarText(sizeInfo);
Here's the changed prototype:
void setStatusBarText(CString newText){ m_bar.SetPaneText(NULL, newText, true); }
I ran into that error before, that's why I tried the static keyword.
|
|
|
|
|
You need to have an instance of C489guiFrame
LighthouseJ wrote:
C489guiFrame::setStatusBarText(sizeInfo);
then becomes
C489guiFrame myGUIFrame;<br />
<br />
myGUIFrame.setStatusBarText(sizeInfo);
or something similar.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
But wouldn't that create another window? I have this also in the file, doesn't this create the window?
<br />
class C489guiApp: public CWinApp {<br />
public:<br />
BOOL InitInstance() {<br />
m_pMainWnd = new C489guiFrame;<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();<br />
<br />
return TRUE;<br />
}<br />
...<br />
}<br />
When I want to set the text, can't I say m_pMainWnd->setStatusBarText(sizeInfo); ? I'm trying that which should be in my derived class but it's not in the little list.
|
|
|
|
|
LighthouseJ wrote:
But wouldn't that create another window?
My intension was to give an example of how to access a non-static member function. Sorry if this was confusing.
OK given the information you have supplied.
The problem is that m_pMainWnd is a pointer to a CWnd object. You need to cast it to a C489guiFrame object.
You can either do
C489guiFrame* pFrame = reinterpret_cast<C489guiFrame*>(m_pMainWnd);<br />
ASSERT(pFrame != NULL);
from within the CWinApp derived class
or
C489guiFrame* pFrame = reinterpret_cast<C489guiFrame*>(AfxGetMainWnd());<br />
ASSERT(pFrame != NULL);
from other classes
then use pFrame to call its member function
pFrame->setStatusBarText(sizeInfo);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
How can I disable MRU list from my SDI application. I have tried ON_UPDATE_COMMAND_UI_RANGE and ON_UPDATE_COMMAND_UI but nothing seems to work. when I put these message handlers, the MRU list totally vanishes. I am a bit stuck here.
Nick in Progress
My Articles
|
|
|
|
|
Hi,
First you call CWinApp's LoadStdProfileSettings(0) in InitInstance. And remove all MRU menu items from the resource menus.
Regards,
Selvam
|
|
|
|
|
I know this method but I wanted to disable the MRU items temporarily during some operation. By doing this, it will show and MRU list with 0 items so its of no use to me.
Anyways, I have done this by writing a custom Message Handler.
Thanx for your response.
Nick in Progress
My Articles
|
|
|
|
|
Hi:
I need to capture an image made in my window (with MoveTo and LineTo functions) and stretched it to another size.
How can I make it?
thanks,
|
|
|
|
|