|
vikrams wrote:
What is the difference between global variable & static global variable?
I never knew there was one...or that anyone would use the static modifier on a global variable.
How do I print my voice mail?
|
|
|
|
|
hm.. as I remember, if you use static on a global variable, it is only visible in this single cpp file for the linker.
|
|
|
|
|
Hello Vikrams,
A global variable and a static global variable are both global variables. That is, they are not defined in the context of any C++ class. Examples :
int g_int = 0;
static int g_static_int = 0;
The difference between a global variable and a static global variable is that the global variable can be accessed in any CPP file while the static global variable can only be accessed within the CPP file in which it is defined.
Example :
source1.cpp :
int g_int = 0;
static int g_static_int = 0;
void func1()
{
...
g_int = 20; // OK !
...
}
void func2()
{
...
g_static_int = 35; // OK !
...
}
source2.cpp :
extern int g_int;
extern int g_static_int;
void func3()
{
...
g_int = 81; // OK !
...
}
void func4()
{
...
g_static_int = 19; // Not OK ! You will get a linking error.
...
}
-Bio.
|
|
|
|
|
Well.. I got it. Thanx a lot.
VikramS
|
|
|
|
|
hi,
I m using DirectSfow to Priview Video .
and in hardware i m using Tv Tunner Card.
wt are the Video streaming rates/ frequencies .
does these are of DirectShow then wt they are , and how can i change.
does it depends on TV Tunnver Card setting
thanx
Regards.
|
|
|
|
|
Query the output pin on the source filter you're using, to find out what media type it is using.
It's all in the DirectShow documentation.
Jon
#include <beer.h>
|
|
|
|
|
Hi All,
What I am trying to do is, when a button is pressed in my application, it opens a browser that looks very similiar to the Windows XP F11 Theatre view except that it has the menu and the status bar would be down the bottom.
To this end I thought I would a IWebBrowser2 object, find the applicable toolbars in the rebar control and move them to where I want them to go.
Here is what I have so far:
HRESULT hr = CoCreateInstance(CLSID_InternetExplorer,
NULL,
CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2,
(void**)&m_pWebBrowser2);
hr = m_pWebBrowser2->QueryInterface(IID_IWebBrowserApp,(void**)&m_pIEApp);
long hIE;
// get a window handle so we can resize and show the browser window.
hr = m_pWebBrowser2->get_HWND(&hIE);
hr = m_pWebBrowser2->put_AddressBar(true);
hr = m_pWebBrowser2->put_StatusBar(true);
hr = m_pWebBrowser2->put_MenuBar(true);
hr = m_pWebBrowser2->put_ToolBar(true);
// use CWnd to make showing the window etc easy
m_wndWebBrowser.Attach((HWND)hIE);
m_wndWebBrowser.ShowWindow(SW_SHOWMAXIMIZED);
//REBAR CONTROL
//Find Rebar Control
CWnd* workerWnd;
CWnd* rebarWnd;
bool foundPersonalBar = false;
long childcount = 0;
UINT searchState = GW_CHILD;
while(!foundPersonalBar)
{
workerWnd = m_wndWebBrowser.GetWindow(searchState);
searchState = GW_HWNDNEXT;
childcount = workerWnd->GetWindowedChildCount();
if(childcount != 1)
continue;
rebarWnd = workerWnd->GetTopWindow();
if(!rebarWnd)
continue;
childcount = rebarWnd->GetWindowedChildCount();
if(childcount <= 3)
continue;
foundPersonalBar = true;
}
At this point rebarWnd is the rebar that I need (ie. the parent to the toolbar, menubar, etc) but I am not sure where to go from here.
The problems I am finding are:
- I cannot determine which of the child toolbars is the address bar, which is the menu bar, etc, etc
- How to move them
This will probably be a very easy thing to do but I am fairly inexperienced in this kind of programming.
Any help would be appreciated.
|
|
|
|
|
I have a program with multiple doc/view in order to read STL files. If I just open the file and then close the file again and again, I can’t open any window finally, even opening a pop-up menu in another process is unavailable. I think that there must be a resource leakage, but I don’t know how to detect a resource leakage. Thanks for your help!
|
|
|
|
|
If you are using the CRT, you can enable CRT leak detection and then dump a report on exit. It will then list all your leaks.
A better solution is to use some type of leak detection software, but the generally cost money.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks for your help. I will try it.
|
|
|
|
|
Hi all,
I am trying to compile a sample project. However, I got this messages:
d:\C++ EXAMPLE\Chart2_src\CodeGuru\GuiLib\ChartDll\DataSeries.cpp(865): error C2668: 'atan' : ambiguous call to overloaded function
I cannot find atan() function used in the code, what's happened? Did anyone face similar problem before? The following is the source which caused this error...
<br />
<br />
<br />
void CDataSeriesArray::DrawData(CMemDC* pDC, C2DScale* pScale) {<br />
<br />
m_pDC = pDC;<br />
m_pScale = pScale;<br />
<br />
<big> int nY = (int)(m_pScale->m_yDepth*sin(D2R(m_pScale->m_dVertRotation)));<br />
int nX = (int)(m_pScale->m_yDepth*sin(D2R(m_pScale->m_dHorzRotation)));</big><br />
<br />
blah...<br />
blah...<br />
blah...<br />
Any help is appreciated!
Help! I need somebody help!
Would you please help me?
|
|
|
|
|
What is the definition of D2R() ?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Heh, it better be defined as
((x)*PI)/180
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I agree, but that's the only thing I can think of that would cause his problem with atan()...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
While it is assumed that D2R is "degree to radian," it is also likely that D2R includes the use of PI, which can be defined as 4.0 * atan (1.0). In that case, you could get an error involving atan. I assume you have #include math.h?
You could also just assign PI a value of 3.14159 etc, depending upon the accuracy you need, if it is indeed used in D2R.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hello,
I am having problems creating queues and I would like code, non-MFC, but pure C++ that allows a user to insert data into a queue and then display it all when they are done. Just a simple command line program. I know to use classes.
Thank you for reading.
-Ryan M.
|
|
|
|
|
Why don't you have a look at the STL queue class? Sure beats writing your own
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi~
I'm a printer driver developer in Yang-jae System which develop printers, Korea.
I have a question on TCP/IP Printer Port.
When using a print server, creating a TCP/IP port must be done.
On Windows 2000, XP and 2003, Standard TCP/IP Port is provided by OS,
but On Windows 98 and Me, Standard TCP/IP Port is not provided by OS.
So, a Vendor provides a program creating a TCP/IP Port.
I want to implement this program.
I don't know the way to create and add an TCP/IP Port at all.
Can I get your advice or outline on this?
Please help me...
Have a nice day!
|
|
|
|
|
TCP / IP provide port in the window 98 , me that it can,t operation.
because of no more provided to micro soft company, TCP / IP attend to exchange window 2000,xp i think... so your printer port look for compactly all of them. firt of all reference learn TCP/IP protocals.
i recommand in msn under the website. I look up the benefical reference.
i can try to learn as a vendor.
i like that you are little better than advice.
have a great day ?
see you.
|
|
|
|
|
pls help me in this because i do not know the right commands to be used in programing the transfering of wav file from one pc to another using parallel port. Thank a lot!you are greatly appreciated!
|
|
|
|
|
Hi, is there an easy way to Generate a GUID from code with Visual C++. The only references i can find involve COM. Is there any support from MFC?
thanks in advance
Carl
|
|
|
|
|
Hello Carl,
Try : UuidCreate() or UuidCreateSequential().
Regards,
Bio.
|
|
|
|
|
thanks Bio.
Carl
|
|
|
|
|
Hello all,
I'm trying to figure out what I'm not seeing here. Check out the code fragement...
void CHELPTSTDlg::OnButton1()
{
AfxMessageBox("Ooh baby", MB_HELP, 1234);
}
BOOL CHELPTSTDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
CString c;
c.Format("In Help info, ID = %d", pHelpInfo->dwContextId);
AfxMessageBox(c);
return CDialog::OnHelpInfo(pHelpInfo);
}
The pHelpInfo->dwContextId variable is ALWAYS 0 in the OnHelpInfo handler. Anyone have any ideas what I'm missing? Simply trying to start WinHelp with the context ID I pass in the message box.
Thanks!
Paul...
|
|
|
|
|
It's been a while since I've done this, so I was wondering how everyone is building help files these days? Last time I did it I was making a .hlp file, but now I think it is .chm ... right? So - anyone know how to create these?
Thanks!
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|