|
Is anyone familar with MSBNx Bayesian Networks, created at Microsoft Research. I have correctly imported the Activex but I get an error here which are arguements into the api function.
<br />
<br />
#include "stdafx.h"<br />
#include "bn.h"<br />
#include "bnDlg.h"<br />
#include "models.h"<br />
.....<br />
void CBnDlg::OnButton1() <br />
{<br />
CModels model1;<br />
model1.Add("jps", "C:\\belief.xbn", "C:\\error.log", ine_Default, recommendtype_Default);<br />
<br />
}
C:\Backup2\projects\bn\bnDlg.cpp(178) : error C2065: 'ine_Default' : undeclared identifier
C:\Backup2\projects\bn\bnDlg.cpp(178) : error C2065: 'recommendtype_Default' : undeclared identifier
I
Add (Models)
http://www.research.microsoft.com/adapt/MSBNx/msbn3/Methods/Add-Models.htm[^]
http://www.research.microsoft.com/adapt/MSBNx/faqs.aspx[^]
all of the example code from MS is in VB
Later, JoeSox www.humanaiproject.org
my friend's Hawaiian Art :
http://www.cafeshops.com/coolroxart
|
|
|
|
|
I have posted several questions on this project, and every answer has gotten me a little closer to my goal. I am stuck AGAIN so, here it goes:
void __stdcall GetAccount(_clsAccount &Acct)<br />
{<br />
HRESULT hr;<br />
dbAccount dbAcct;<br />
<br />
hr = CoInitialize(0);
if (SUCCEEDED(hr))<br />
{<br />
hr = CoCreateInstance( CLSID_clsAccount, <br />
NULL, CLSCTX_INPROC_SERVER, IID__clsAccount, (void**) &Acct); <br />
<br />
if(SUCCEEDED(hr))<br />
{<br />
if(dbAcct.Open())<br />
{<br />
_bstr_t bstr1(_T("This is the test string."));
Acct.put_AccountName(bstr1); ***********<br />
dbAcct.Close();<br />
}<br />
}<br />
CoUninitialize();
}<br />
}
The line Acct.put_AccountName(bstr1); (marked with ***) causes an Access Violation error, and I don't know why.
FYI. If I define the function as
void __stdcall GetAccount(_clsAccount *Acct)
and try to use Acct->put_AccountName(bstr1); to set the value...the same error occurs.
Please help if you can!
Thank you.
|
|
|
|
|
Post the interface and implementation of put_AccountName().
Kuphryn
|
|
|
|
|
this is a little odd, but...put_AccountName is actually defined in a VB DLL I wrote, and is the 'Property Let' method for the AccountName property. The definition, in VB is:
Public Property Let AccountName(ByVal vData As String)<br />
mvarAccountName = vData<br />
End Property
Not much to it. It just stores the string passed to it in a member variable in the Account class. I don't know why, when the object is created in C++, the method is called put_AccountName instead of just AccountName. I assumed that was a default behavior when C++ interprets a VB-defined class object.
Am I way off base here?
Sorry if these are dumb questions...I am VERY new to C++.
Thanks for your help.
|
|
|
|
|
Maybe you should post this on the COM message board
|
|
|
|
|
yeah. I did at first, but then I changed my mind, because I have had such good response on this message board with previous questions.
Thanks
|
|
|
|
|
If I just know the resource ID of a control and it’s not connected to a View statically, I dynamically add the control to the view; the Object ID of that control is not shown in the class wizard of that View.
My question is how to handle events on that control? And how do I know what are the different events triggered by that control? How do I write the handler?
|
|
|
|
|
Take a look at the code the Wizard generates for you - all you need is an ID (which you can pick at random, or use the resource editor to reserve).
Add the message map entries for the event handlers, using the ID you picked to identify the control. Then, use that same ID when you create the control at run time!
Shog9
I returned and saw under the sun,
that the race is not to the swift,
nor the battle to the strong...
|
|
|
|
|
I need a way to create a dialog that is invisible. I am using Chris's tray icon class to control the entire project. I understand ShowWindow(SW_HIDE) but I also want the application NOT to show up in the taskbar.
Best Wishes,
Marty
Update
I found this in msdn!
Visibility of Taskbar Buttons
The shell creates a button on the taskbar whenever an application creates a window that isn't owned. To ensure that the window button is placed on the taskbar, create an unowned window with the WS_EX_APPWINDOW extended style.
To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
Anyone have an idea on how to do this with a simple dialog?
I can do it with win32 but I was hoping not to lose some mfc classes I need.
Thanks
Marty
|
|
|
|
|
One solution is SetWindowPos().
Kuphryn
|
|
|
|
|
Good idea Kuphryn
So you think I can eliminate it from the taskbar by using SetWindowPosition? MSDN shows the following parms for SetWindowPos. SWP_HIDEWINDOW will certainly hide the window but it shows in the taskbar.
Best Wishes, Marty
BOOL SetWindowPos(HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);
Parameters
hWnd
[in] Handle to the window.
hWndInsertAfter
[in] Handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of the following values.
HWND_BOTTOM
Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.
HWND_NOTOPMOST
Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.
HWND_TOP
Places the window at the top of the Z order.
HWND_TOPMOST
Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.
For more information about how this parameter is used, see the following Remarks section.
X
[in] Specifies the new position of the left side of the window, in client coordinates.
Y
[in] Specifies the new position of the top of the window, in client coordinates.
cx
[in] Specifies the new width of the window, in pixels.
cy
[in] Specifies the new height of the window, in pixels.
uFlags
[in] Specifies the window sizing and positioning flags. This parameter can be a combination of the following values.
SWP_ASYNCWINDOWPOS
If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
SWP_DEFERERASE
Prevents generation of the WM_SYNCPAINT message.
SWP_DRAWFRAME
Draws a frame (defined in the window's class description) around the window.
SWP_FRAMECHANGED
Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
SWP_HIDEWINDOW
Hides the window.
SWP_NOACTIVATE
Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
SWP_NOCOPYBITS
Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
SWP_NOMOVE
Retains the current position (ignores X and Y parameters).
SWP_NOOWNERZORDER
Does not change the owner window's position in the Z order.
SWP_NOREDRAW
Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
SWP_NOREPOSITION
Same as the SWP_NOOWNERZORDER flag.
SWP_NOSENDCHANGING
Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
SWP_NOSIZE
Retains the current size (ignores the cx and cy parameters).
SWP_NOZORDER
Retains the current Z order (ignores the hWndInsertAfter parameter).
SWP_SHOWWINDOW
Displays the window.
Best Wishes,
Marty
|
|
|
|
|
ModifyStyleEx( 0, WS_EX_TOOLWINDOW );
Joel Lucsy
|
|
|
|
|
I have to take a test as part of the application process for a specific programming job. A specific question, which I'll post on here, has me a little bit confused, and I just wanted to see if I'm just reading it wrong...I would like some opinions before I write this program incorrectly. Here's the question:
"Write an optimized C program to convert a base 16 number to its base 10 equivalent, without using the standard C libraries, i.e. don't use scanf("%x"). The program should allow the user to input the number. State any assumptions you made when writing the program. Use 23DA as a test number."
Ok, that was the question I have to "answer." Here's what I'm curious about, and would like some insight...if I can't use any of the standard C libraries, exactly how am I to input the number from the user? I am assuming I should keep this as simple as possible and create a console application, which is what I intend to do. How else would I get the input, I mean I could use command line arguments, but that's hardly allowing the "user to input the number." And I still wouldn't be able to display the number without using any of the standard libraries. Please, I need some clarification on this from all of the pros who help us intermediates on this site!!! Thanks so much
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
DougwW48 wrote:
without using the standard C libraries
I assume this means don't use libraries for the conversion ONLY
DougwW48 wrote:
State any assumptions you made when writing the program
State that you assumed that standard libraries/CMD line args could be used for inputting the values. You could suggest that they tightend up their method of writing specifications!
It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman
|
|
|
|
|
The mean purpose of the specification is to force you to design a solution without the help of a library API. It does not include I/O.
Kuphryn
|
|
|
|
|
They want to verify that you can handle the task of converting numbers from base 16 to base 10 without using stdlib - thus proving that you understand "COMPUTERS"
Can you
I doubt very much that their intent was to force you to write the simple but infinitely tedious console i/o routines.
|
|
|
|
|
Of course I can convert a hex number into decimal. You bit shift your total to the left 4 digits, then add the next number from your hex string! My biggest concern was that they specified not using scanf("%x") which I later looked up. You guys (and ladies) are all correct, they don't care that I use scanf, they just don't want me using %x because that will read a number already formatted in hexadecimal, which defeats the entire purpose of the program!
Thanks for the response though, I appreciate it!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
Does anybody know how to get the number and letters of local drives on a system?
|
|
|
|
|
|
I am new to designing my own OCX Controls and have managed to "hack" my way through and develop a workable control that seems to work. I was able to add in the Stock Properties OK and they too work. Somehow I managed to get Visual Studio (7.0) to add a COleControl wrapper class which is my interface to programatically change the stock properties. So far, so good.
I now wish to further add some variables that CxxxCtrl.cpp can access. It is at this point that I am throughly confused as to how to do this manually now that the control has been constructed.
A simple walk thru of "CWrapperClass::SetMyNewVariable(short NewVariable)" in the COleControl wrapper class and winding up in CxxxCtrl.h as "short m_MyNewVariable" in CxxxCtrl.h will do or even a reference to an article that will help me understand how to get from point A to point B.
This is strictly a run time function and does not to be persistantly stored or an ambient property.
Help, I'm running out of hair to pull out.
Thanks.
Barry
|
|
|
|
|
I want to be able to put in a line in the version info that specifies what the build is - e.g., Unicode Release, ASCII Debug, etc.
I tried to define a variable in the RC2 file (well, actually in an include file included from the RC2 file) that does this:
#ifdef _DEBUG
#ifdef UNICODE
#define VER_BUILDTYPE "Unicode Debug\0"
#else
#define VER_BUILDTYPE "ASCII/Multi-byte Debug\0"
#endif
#else
#ifdef UNICODE
#define VER_BUILDTYPE "Unicode\0"
#else
#define VER_BUILDTYPE "ASCII/Multi-byte\0"
#endif
#endif
PRoblem is, the define always says "ASCII/Multi-byte", as if UNICODE and _DEBUG aren't defined in resource files.
Is there any way to do what I'm attempting to do, short of going in the resource properies and manually defining symbols for all configurations?
Thanks.
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Well, I found *one* way of doing what I want:
Simply define this string for all configurations in the "Resources" tab, "Defines" edit field:
VER_CFG=\"$(ConfigurationName)\0\"
And then reference VER_CFG wherever I need to in my RC files. This is less evil than having to put in the Debug and Unicode defines in the appropriate places, since at least one define can be used across all configurations here.
Still not sure why resources wouldn't automatically get the other project defines, though...
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
The defines are all passed in as command line arguments /Dxxxx=somevalue /Dxxxxx etc.
The resource compiler, MIDL compiler and C/C++ compiler all use individual settings. Defining _UNICODE isn't done for resource compilations or IDL compilations because it's a no-op. All resources are UNICODE for Win32 platforms.
In VC++6 you can go to 'Project/Settings' menu item, find your RC file and then see what additional defines you do/don't want for the various builds.
Steve S
|
|
|
|
|
I want to programmatically turn off the video signal so my display will power down into standby. I'd like to selectively turn off each video signal on a dual-channel VGA.
I did this years ago by tweaking a VGA register under DOS. Now I'm looking for a Windows API to do it.
Any suggestions? Examples?
Alternatively, I've heard there's a VESA standard to send device control info via the VGA port?
TIA
|
|
|
|
|
I have an application written in VC++6 that has been working great for some time, but I recently added a menu bar item with two submenu selections to respective message handlers.
It works well on my machine and any others in my group that have VC++ installed, but doesn't show any response, error or change if these new sub-menu items are selected on any other machine.
Our plant just changed over to XP at the same time, (so the water is now muddy!) but we can't find any hard correlation except that the custom menu selections (previously added in other versions) that used to work with the old workstations under Win98 are now giving a message
"Attempted an unsupported operation!"
Does anyone have any suggestions?
I will add some prompts to see if I even get into the message handler, but I don't think that it does!
David Leikis
ATK Thiokol Propulsion
Laboratory Automation
|
|
|
|