|
yup it is my dialog editbox ID.
|
|
|
|
|
i am veri desperate to link my database to a dialog(no formview/record view) if possible, is there any good samples around of a dialog which pop the database? thanx!
|
|
|
|
|
Did this not help at all?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I have a VB program and I would like to run it in VC++,
is that possible?
Ehsan Behboudi
|
|
|
|
|
If your VB program is a com dll/exe, then using it in VC++ is no different than using a com object written with VC++.
If it is a regular exe, then you can use the CreateProcess function (see MSDN for details).
My articles and software tools
|
|
|
|
|
yes, the VB objects are all COM objects.
I have a whole bunch of functions in VB,, which I would like to use in VC++.
They are all COM objects.
How can I use the functions, or include the .bas in my VC++ so I could just call the functions in VC++.
Ehsan Behboudi
|
|
|
|
|
mr2003 wrote:
How can I use the functions, or include the .bas in my VC++ so I could just call the functions in VC++.
You can't use the .BAS functions.
If you look up #import on MSDN, you should be able to call your VB COM objects from C++ easily.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I want to make a game of tic tac toe that will respond kinda like a real life person does in a game. I already have everything laid out and made it's just that I'm having difficulty making the comp respond. See, I added a seperate function for the comp move. I added also "if ( middle is blank then make a move their... then that's were everything goes blank... my board is set up by an array... matrix[3][3]... I would like the comp to check if there are any rows empty and if so then try to fill one up... also would like to check if the comp can block the user and if the user blocks the comp then try new colomn / row...
1 2 3
1 | |
---|---|---
2 | |
---|---|---
3 | |
Please Help!!!
<marquee>Universal Project... Soon to be a .net
|
|
|
|
|
Working with AI is like asking how a long a piece of string is. There is no definitive answer. However, the techniques used in games and indeed everywhere, construct their AI using a rule based methodology. You need to gradually develop rules that define the scope of consideration for the computer. If a player moves in a left column, then you need to do defensive checks first, for instance, to make sure the computer does not lose on the next move, before making an attacking move that will put the opponent in danger of losing. That is one rule that implements a defense before attack strategy (you may want to do something else). But that is the first basic strategy of the computer. You can then build on that, if I need to do a defense move, what should I consider etc. If you look a Bantumi on nokia phones, on easy mode, its possible to beat the computer with the exact same moves every time, because its a fixed rule based system (no random decisions), you may also want to incorporate random decisions further down the line (i.e. have a number of potential moves and instead of selecting the 'best' select one at random), this may make it easier and more human like . Obviously I can't code it for you cos that would take a fair amount of time, though not that much for a uni project Good luck.
Alan.
|
|
|
|
|
Hi,
In my SDI application, I have 2 tree controls in a formview, which can be selected by tab control. On tabchange(), I select the root of the tree in which I switched. But, as soon as I switch although it actually selects the root items of the trees, the whole tree becomes grayed and if I have to click on the tree control to see the items. Please help, following is the way I do it:
if (m_TabCtrl.GetCurSel( ) ==1 )
{
m_TreeCtrl2.SelectItem(NULL);
m_TreeCtrl2.SelectItem (m_TreeCtrl2.GetRootItem());
}
if (m_TabCtrl.GetCurSel( ) ==0 )
{
m_TreeCtrl1.SelectItem(NULL);
m_TreeCtrl1.SelectItem (m_TreeCtrl1.GetRootItem());
}
I have to deselect the item first and then select it, because this way my application works, that why using m_TreeCtrl1.SelectItem(NULL);
Binayak
|
|
|
|
|
I have specified WS_HSCROLL and WS_VSCROLL for my list box in the resource file.
When the listbox is full vertically, the vertical scrollbar shows up as expected. However, when a long item is entered into the list box, the horizontal scroll bars do not show up. Why would the vertical ones show up and not the horizontal ones?
I would appreciate any help on getting the horizontal ones to show up properly also.
Thanks.
Martin
|
|
|
|
|
when adding strings to the list box, you need to set the horizontal text extent so that the listbox knows that it needs to put up the horizontal scroll bars (one of my pet peeves!)
<br />
int nExtent = m_ErrorList.GetHorizontalExtent();<br />
CDC *pDC = GetDC();<br />
CSize sizeTextExtent;<br />
<br />
if ( m_pStrings )<br />
{<br />
CString cstrString;<br />
for( int i=0; i < m_pStrings->GetSize(); i++ )<br />
{ <br />
cstrString = m_pStrings->GetAt( i );<br />
sizeTextExtent = pDC->GetTextExtent( cstrString, cstrString.GetLength() );<br />
if ( sizeTextExtent.cx > nExtent )<br />
nExtent = sizeTextExtent.cx;<br />
<br />
m_ErrorList.AddString( cstrString );<br />
}<br />
}<br />
<br />
m_ErrorList.SetHorizontalExtent( nExtent );<br />
ReleaseDC( pDC );<br />
|
|
|
|
|
|
Hello,
I don’t quite understand how everything works with sockets, and was wondering if someone could clear up a few questions I have.
Dealing with stream sockets.
To make this easier for me to understand I will give you a simple example. Lets say I have a server application and several clients. Lets say one of the clients sends some data to the server.
My first question is - In the server application does the server socket wait until it receives everything from the client before it issues a FD_READ to the application?
Second question, (if the first question is no and I'm sure it is) is there a maximum size that you can send through a socket to ensure that the data isn’t chopped up so that the FD_READ issued is guaranteed to be the full amount of data sent and not part of it?
I have a bad feeling that both the answers to my questions are no and this can make it really difficult to keep track of who sent what especially dealing with lots of clients sending data to the server.
Last but not least can anyone recommend a good WinSock book? I have Network Programming with Windows Sockets by Pat Bonner. It’s pretty good but most of the material deals with one client and one server, and it geared toward WinSock1.
Thanks for taking the time to read my post!!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Are you wanting to read text from the socket one complete line at a time?
|
|
|
|
|
Pretty much.. I am actually sending a Structure through the socket.. and after some debugging I find that sometimes I get a FD_READ issued and only half of the structure is there to read..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
OK, well i created this[^] to grab text out of a socket one line at a time... binary is somewhat similar, but instead of looking for a line of text (with \n being the end indicator) you would look for a particular structure... and instead of a "ReadTextLine" function you would need something like a "ReadStruct" to get the structure out. similar concepts. basically collect what you get, put it in something, and then when you get what you want, take it back out and use it.
|
|
|
|
|
If all else fails, try the FAQ.
http://tangentsoft.net/wskfaq/[^]
There is a book review section as well.
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
Why doesnt my program recive them the messages seem to go straigh to the toolbar i have tried to map OnKeyUp OnKeyDown OnChar all at once and non work
here is the code im using for all 3 of them
void DlgMapEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case VK_UP:
curr_room.y -= 1;
MessageBox("Key Up OnChar");
break;
case VK_DOWN:
curr_room.y += 1;
break;
case VK_LEFT:
curr_room.x -= 1;
break;
case VK_RIGHT:
curr_room.x += 1;
break;
}
UpdateDisplay();
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
the code for all 3 is relitivly the same but it doesnt even get to the message box
so whats the deal is there something special i have to do?
when i hit the arrow keys it moves around the selected button on the toolbar and i dont want that :P
i also tried to use OnSysKeyUp OnSysKeyDown and OnSysKeyChar but none of them work it all goes to the toolbar
SOMEONE PLEASE HELP!!!!!
thanks
|
|
|
|
|
Dialogs do there own keyboard handling, so you won't see keys like VK_UP. You'll need to get in before the normal dialog processing does. Try PreTranslateMessage() - not sure if that works with dialogs though.
Hooking these keys in a dialog seems strange though.
If you look below the editing window you will see a toolbar to format code etc. Please try and use that.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I am thinking of buying "Microsoft Visual C++ .NET (Standard)" but I am confussed about the ".NET" bit. I am a C++ programmer - I program Win32 (sometimes MFC but usually just Win32) and DirectX (i am currently using VC++ 6) and I was wondering if this new version of VC++ allows you to create programs without having to use the .NET framework (basically like you would normally with VC6)?
|
|
|
|
|
|
Anonymous wrote:
I am a C++ programmer - I program Win32 ... and DirectX
One good reason to upgrade to VS.NET for DirectX development is the DirectX debugging extensions for VS.NET (including shader debugging, breakpoints on screen areas, texture inspection, etc.) that is included with the DX9 SDK (you'll need to reinstall the SDK after installing VS.NET and you currently need to be on WinXP).
- Mike
|
|
|
|
|
Thanks to both of you for your quick responce.
|
|
|
|
|
On the fly, I want my prog to make a list of the files in a directory. SO in DOS I would say
e:\> cd myDir<br />
<br />
myDir:\> dir/b > myList.txt . How do I get this functionality to occur in my MFC program?
Thanks
Appreciate your help,
ns
|
|
|
|