|
Why you've not given the input file format? If you provide think it will be easier to answer your question.
Tomorrow is a blank page
Let me know if I am wrong with the information above
|
|
|
|
|
Thanks for pointing that out Manir.
The file is from a preprocessor called NASTRAN(Fintite Element calculations on mesh). It's a file in ASCII format called f06.
|
|
|
|
|
I am not sure if I really have understood your problem. But if you are trying to go to a location containing a predefined string you can use Knuth-Moris-Patt method to find it from a stream.
Tomorrow is a blank page
Please let me know if I am wrong with above information
|
|
|
|
|
Hello !
I need to know all the available COM ports on my computer. How can I do that ? Is it a function for doing that ?
Thanks
|
|
|
|
|
here is small code snippet,i found it from CSerrailPort clas at CP
// prepare port strings
sprintf(szPort, "COM%d", portnr);
sprintf(szBaud, "baud=%d parity=%c data=%d stop=%d", 19200, 'N', 8,1);
// get a handle to the port
m_hComm = CreateFile(szPort, // communication port string (COMX)
GENERIC_READ | GENERIC_WRITE, // read/write types
0, // comm devices must be opened with exclusive access
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
FILE_FLAG_OVERLAPPED, // Async I/O
0); // template must be 0 for comm devices
if (m_hComm == INVALID_HANDLE_VALUE)
{
// port not found
delete [] szPort;
delete [] szBaud;
return FALSE;
}
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi !
Thanks for your response but this is not what I'm looking for. I don't want to open every port to test if it exists. I'm lloking for a function (or maybe something in the registry ?) that gives me all the ports available on my machine.
|
|
|
|
|
You can detect all installed com ports by looking in the registry under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM"
Forever Developing
|
|
|
|
|
Not sure if this will help but if you look in the registry
HKLM\SYSTEM\CurrentControlSet\Services\Serial\Enum
Gives a list of serial devices and a count!?
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 Williams (Little Britain)
|
|
|
|
|
I think I've found another key that may help me:
HKEY_LOCAL_MACHINE\Hardware\deviceMap\SerialCOMM
and there is a list of (I think) all the serial port of my machine (virtual or not). Do you think this is a valid key (present on all computers) ?
Know, I want to retrieve the names (COM1, COM3, ...) but I don't know how to do this ? I can retrieve the number of 'values' but how can I retrive their values (I don't know the names of these keys...)
Any idea ?
Thanks
|
|
|
|
|
You can enumerate the registry by using
RegEnumValue
Check you local MSDN help files for more info
Forever Developing
|
|
|
|
|
Ok thanks, I will take a look.
This is the first time I use the registry so if you can point me to an article or something that describes how to use it correctly that would be nice
(In the MSDN, there is no doc about that, just the different functions and what they do )
|
|
|
|
|
Here is a code project artical on the subject
http://www.codeproject.com/useritems/serial_portsenum_fifo.asp
Forever Developing
|
|
|
|
|
Yup, they are available on Win2003, XP and W2K at least.
It appears that the names of the keys will be \Device\Serial<n>
where <n> is a number from 0 upwards! If you read the number of devices from the Enum of the serial section (as i described above) then you could loop round reading the device map names as you have found (altering <n> for each iteration of the loop).
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 Williams (Little Britain)
|
|
|
|
|
Hi Friends,
What is the difference between global variable & static global variable?
Consider C and C++ .
VikramS
|
|
|
|
|
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?
|
|
|
|