|
Thanx Mike, found the problem. Didn't have Service Pack 5 lol. Everything's working fine now, plain sailing.
Later
The more knowledge we gain, the less we understand
|
|
|
|
|
It sounds like your app is not using the DLL you link with. What the version of the MFC42D.DLL your app is using?
We do not inherit the Earth from our ancestors, we borrow it from our children - Antoine de Saint-Exupéry (1900-1944)
|
|
|
|
|
I was thinking the same thing and I came back to ask that question but you beat me.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
For some reason you don't have up to date dlls in your system directory. Download and install service pack 5 and all should be well.
John
|
|
|
|
|
MFC42D.DLL是安装VC++时的可选安装,所以你将光盘放入,重新安装它即可!
|
|
|
|
|
I have a program that utilizes SAPI 5.0 to handle voice recognition to
execute a set list of commands. The grammar is currently being handled by a
static XML grammar file but I would like the user to be able to specify the
terminology to execute each command.
This is the current XML file
--------------------------------------------------------------
<GRAMMAR LANGID="409">
<DEFINE>
<ID NAME="VID_LDblClk" VAL="14"/>
<ID NAME="VID_LDrag" VAL="15"/>
<ID NAME="VID_LSglClk" VAL="16"/>
<ID NAME="VID_RDblClk" VAL="17"/>
<ID NAME="VID_RDrag" VAL="18"/>
<ID NAME="VID_RSglClk" VAL="19"/>
<ID NAME="VID_ReleaseDrag" VAL="20"/>
<ID NAME="VID_CmdType" VAL="255"/>
<ID NAME="VID_Commands" VAL="257"/>
</DEFINE>
<RULE ID="VID_Commands" TOPLEVEL="ACTIVE">
<O>Please</O>
<RULEREF REFID="VID_CmdType" />
</RULE>
<RULE ID="VID_CmdType" >
<L PROPID="VID_CmdType">
<P VAL="VID_LDblClk">left double <O>click</O></P>
<P VAL="VID_LSglClk">left <O>single</O> click</P>
<P VAL="VID_LDrag">left drag</P>
<P VAL="VID_RDblClk">right double <O>click</O></P>
<P VAL="VID_RSglClk">right single <O>click</O></P>
<P VAL="VID_RDrag">right drag</P>
<P VAL="VID_ReleaseDrag">release drag</P>
</L>
</RULE>
</GRAMMAR>
--------------------------------------------------------------
Right now to execute a left double click the user must say "left double
click" but they might want to say "double left click" or anything else, so I
want to give them the ability to change the grammar while using the program.
Is this possible?
Thanks in advance,
~Logan
|
|
|
|
|
Has anyone attempted to develop a VST host? I'm keen to have ago for a granualar synthesis program i writing, but everyone I know has run in fear of attempting it.
If there's any brave soles out there who have given it a go with little or no success would you mind sharing your source with me? I guess if folks succeeded they probabley wouldn't want to share!
If I succeed (and that a big if) I'll do tutorial on here to "share the knowledge".
Ta.
Email:
boutatrain@yahoo.co.uk
|
|
|
|
|
Hi all...
First off, I'd like to thank all whom contribute to this board - it has been an extremely valuable resource for me - a non-programming expert.
I'm a mechanical engineer by trade but have written Visual C++ apps for quite some time; sometimes for fun, sometimes for timesaving. Right now, I'm developing an application that performs some extensive linkage analysis on motorcycle suspensions. As such, I'm using primarily "double" variables.
In the past, when I needed to display these values in my window, I could convert them to a string and write them to a text box and control their format. This time, however, I have simply set the on screen edit box variables as doubles and have direct relationships between my screen variables and my calculation variables to make screen updates and retrieving data from the screen easier/quicker.
However, now when I display the values on the screen, they're written out to some god-awful number of decimal places. Is there an easy way of limiting an edit box's number of decimal places when you do an UpdateData ?
Sorry that this is probably a very lame question, but your assistance is much appreciated.
-Chris
http://www.slideruleracing.com
|
|
|
|
|
In DoDataExchange() , look for the call to DDX_Text() which has the ID of the edit box you're entering. Replace with something like the following:
if ( pDX->m_bSaveAndValidate )
{
DDX_Text( pDX, IDC_EDIT1, m_flData )
<font color="green">
}
else
{
CString sRep;
<font color="green">
sRep.Format( _T( "%.3f" ), m_flData );
SetDlgItemText( IDC_EDIT1, sRep );
} Obviously it's not as tidy as simply calling DDX_Text .
You could add your own overload of DDX_Text if you're going to be doing this a lot. Look at the implementation in the MFC source code in DlgFloat.cpp for an example.
--
Mike Dimmick
|
|
|
|
|
I'd eliminate the use of UpdateData(). For each edit control, assign a CString member variable. When it comes time to update a control, do something like:
CString strSuspension;<br />
strSuspension.Format("%.3f", m_dSuspension1);<br />
m_edit.SetWindowText(strSuspension);
If you need to get the value from a control, use:
m_edit.GetWindowText(strSuspension);<br />
m_dSuspension1 = atof(strSuspension);
There are many ways to tackle this problem.
|
|
|
|
|
OK so I customized the CColorDialog and added a HEX edit box. What I want to know is how can I update this when the user changes a color in the color dialog box? Is there some function or way to tell me when I should change the hex edit box to reflect the current color selected by the user?
|
|
|
|
|
Router
|
|-- 192.168.0.2 <----> 192.168.0.1 (Client1 on LAN1)
|-- 172.16.0.2 <----> 172.16.0.1 (Client1 on LAN2)
|-- 10.10.0.2 <----> 10.10.0.1 (Client1 on LAN3)
Machines Specifications
Router
Windows XP Professional with Service Pack 1
Windows 2000 Server (Dual Boot)
Microsoft Visual Studio 6.0
AMD K6-II 500 MHZ, 256MB RAM
3Com Etherlink III ISAPNP Ethernet Adapter 10Mbps
HP Ethernet with LAN remote power Adapter 10/100 Mbps (PCI)
Intel 21143-Based PCI Fast Ethernet Adapter 10/100 Mbps
Client 1 on LAN 1
Windows 2000 Professional with SP3
Microsoft Visual Studio 6.0
Pentium II 450 MHZ, 256 MB RAM
Realtek RTL8029(AS) PCI Ethernet Adapter 10Mbps
Client 1 on LAN 2
Windows 2000 Professional with SP3
Microsoft Visual Studio 6.0
Pentium III 600 MHz, 128 MB Ram
3Com EtherLink XL 10/100 PCI For Complete PC Management NIC (3C905C-TX)
Client 1 on LAN 3
Windows 2000 Professional with SP3
Microsoft Visual Studio 6.0
Pentium II 266 MHz, 128 MB Ram
Linksys LNE 100 TX Fast Ethernet Adapter (PCI)
This is my network topology. A machine acting as a router is connected to three other machines acting as three different LANs. The problem is with the behaviour of Microsoft’s API Function GetAdaptersInfo(). This function gives complete information about any NIC in a PC such as MAC Address, IP Address, Subnet Mask, Default Gateway etc.
This function works fine when all the PCs are up and network is running. But fails when any one PC from any network is off. GetAdaptersInfo() gives 0.0.0.0 as IP Address, subnet mask etc. of the NIC whose associated network is down. There is nothing documented about this behaviour in MSDN.
One more strange thing is that this function has different behaviour on above four PCs. It works fine regardless of network is up or down on Client1 on LAN1 and on Client1 on LAN2 but fails (means give 0.0.0.0) on Router machine and Client3 on LAN3.
I am unable to understand who is causing this problem.
Whether it is operating system?
Whether it is NIC driver?
or simply it is a bug of GetAdaptersInfo()?
Anybody help please!!!!!!!!!!!1
Thanks
|
|
|
|
|
Hi All,
I am using VC++ 6.0 on a client running Win98.
I need to access a datasource on a webserver running NT 4.0.
The remote database is Access97.
The remote datasource is already set up as a System DSN via ODBC.
The remote datasource is not accessible via a LAN - it must be accessed by domain name or IP address.
I have searced the CDAO documentation but can't determine how to connect to a remote datasource via tcp/ip
Can anyone help with this?
My goal is to populate a combo box with a query from this remote datasource.
I tried ActiveX controls, but the intricacies of creating wrapper classes is beyond me at this time.
It would be faster for me to rewrite the entire project in Visual Basic just so I can use an ActiveX control but I really want to do this in C++.
Does anyone know of perhaps a pre-built class I can drop into my project?
My workaround at this time involves calling a Cold Fusion page on the server and parsing the returned text into the combobox. Very ugly.
Thanks!!!
EDIT
====
Thanks anyways! I cut the Gordian knot and just ported the Access DB over to a MySQL DB and I can connect with a standard ODBC string
|
|
|
|
|
I am trying t create a switch statment that sitches on names in an array
but I can only come up with a the loop below.
Is there a function that will return the numeric value of a char?
char Names[50]<br />
<br />
for(int i=0; i<50; i++){<br />
int temp = (int)Names[i];<br />
if(temp = the number value of 'pla')<br />
then do some stuff<br />
<br />
if(temp = the number value of 'oct'0)<br />
then do some more stuff<br />
}<br />
Steven
|
|
|
|
|
johnstonsk wrote:
the number value of 'pla'
You can not turn a string into a single int and then compair the ints...
[EDIT]
Well if your string is exactly 4 characters you can use a cast like you did in your code sample but this is the only case that it would reliably work...
[/EDIT]
John
|
|
|
|
|
some of the valuse in the char array vary
pla
oct
frozen
stopped
etc.....
steven
any ideas on how to do this?
steven
|
|
|
|
|
If there are more than 4 characters it won't work with just a cast because an int is 4 characters of data. Since there are only 26 letters and less than 4 billion possible english words ( I assume all are spelled correctly and there are no proper names...) you could come up with an algorithm to convert the words to 4 byte numbers.
John
|
|
|
|
|
you can do it on a char level, but you described a string...
'pla' is impossible
What are you trying to do, to comapre strings ?
|
|
|
|
|
What I am trying to do is I have read in a file and put specific name into an array.
For eash name in the array I want to do something different.
I would like to do a switch statemnt on each name in the name array, but a switch has to be an int.
So, I was going to try to spin through the array and for each element in the char array I was going to get its numeric value and compare it to the numeric value of the char I was looking for.
If the numeric values were the same then the chars must be the same and then we have a match.
I hope that all made sense.
thanks, steven
|
|
|
|
|
Well if your string is exactly 4 characters you can use a cast like you did in your code sample but this is the only case that it would reliably work...
John
|
|
|
|
|
Do you have any other ways that I can spin through an array and for each element in it do something different depending on the name??
steven
|
|
|
|
|
Why can't you use a string compare function and put the actual strings in if statements instead of a big switch statement.
John
|
|
|
|
|
This "char Names[50];" is an array of characters not strings/names. If if was a list of known names then you could use "if else" as follows:
if( !strcmp(Names[i],"some name" )
else if( !strcmp(Names[i],"some other name" )
This is 'C' code; in both 'C' and 'C++' there are more complicated, to start with, yet easier to maintain methods of accomplishing your goal.
INTP
|
|
|
|
|
I know I am asking why you are doing something rather than just answering your question so I apologize.
First, there is a way to get the numeric value of a char. Just cast the char as an int and there you go.
Second, there is no numeric value of a string so you can't do what you are asking.
In your sample code, you show:
char Names[50]
for(int i=0; i<50; i++)
{
int temp = (int)Names[i]; // reinitialization error?
if(temp = the number value of 'pla')
then do some stuff;
if(temp = the number value of 'oct'0)
then do some more stuff;
}
Where is your switch statement?
Are you simulating the switch with the if statements?
In the sample shown, you have a single name which can be up to 50 chars long. You are merely comparing 1 letter from that same name at a time. If you need 50 names, you'll need to define a 2 dimensional array like char Names[50][30];
If you absolutely have to use a switch statement (like a school project) you can create a struct which contains a key value and when you populate the struct you can increment the key.
struct NameStruct
{
char Names[50][30];
int key;
};
Then you can use the NameStruct.key value in your switch statement and access the names with NameStruct.Names[key]
If your end goal is to be able to loop through an array of strings and take a different action for each string you could try:
char Names[50][MAX_NAME_LENGTH];
int x;
for (x = 0; x < MAX_NAME_LENGTH; x++)
{
if(!strcmp(Names[x], "Text to compare"))
DoSomething();
if(!strcmp(Names[x], "Other text to compare"))
DoSomethingElse();
........
if(!strcmp(Names[x], "Last text to compare"))
DoSomethingEtirelyDifferent();
}
|
|
|
|
|
for (x = 0; x < MAX_NAME_LENGTH; x++)
Should be
for (x = 0; x < 50; x++)
and you should use the 'if else' construct to avoid unneeded calls to strcmp().
INTP
|
|
|
|