|
typedef Chromosome<CGene> chromosome;
CList<chromosome,chromosome> PopulationArray;
This should work fine. What error messages are you getting when you try this?
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
Thanks for your reply,
The error message that i've got is "no copy constructor to copy the data type Chromosome<cgene>".
For now i can't remember the complete message but i will put it in after i've copied the message.
leonwoo
|
|
|
|
|
|
Hi!!
I am required to develop a Windows NT Service EXE in my project. While reading through MSDN, I came across the "ATL Service EXE" option when developing ATL components.
Could anybody please tell me the the difference between the two?
Which option is preferrable?
What factors does this selection depend on?
Please help me as I am new to VC++!!!
Thanks & Regards,
Nikhil.
(nkapre@hotmail.com)
Nikhil
|
|
|
|
|
What does compiler error 'Float Inexact value' mean? I'm using ATL and automation.
Thanks,
|
|
|
|
|
Hi,
I'm using a VB activeX dll for some string manipulatation stuff. This requires that from the client (VC) i pass strings to VB Dll. What datatype should I use? VB Variant seems to work good. From the client I'm using a CComBSTR to hold value.Ideally the data should be variant but is String also supported?
Thanks,
Amit.
|
|
|
|
|
|
Hi!
I have a video stored in a IStream, anyone know how to play this video without copy it to a file first. (Using an y version of the mediaplayer)
/Markus
Markus
|
|
|
|
|
my app contains a menu with two item.
the 1st item (MENU_ITEM_1), opens a tree, the second item (MENU_ITEM_2) opens a
dialog(1),
when the tree is opened by (MENU_ITEM_1), i made a selection on a tree-item that pops
up a dialog(2),
so i select from menu, MENU_ITEM_2 that pops up dialog(1),
my prblm is that when i reselect from menu MENU_ITEM_1, the tree appears but
the appropriate dialog no ( the MENU_ITEM_2 (dialog1) remains ) even if i send a
"brute"
TVN_SELCHANGED to the same ITEM.....to enforce the rigth dialog(2)...
this is portion of my code: ( in fact its not a menu but buttons that pops up dialog )
portion of code that catch TVN_SELCHANGED to display a dialog for each item:
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
case TVN_SELCHANGED:
hItem = TreeView_GetSelection(hTree);
tvi.mask = TVIF_PARAM|TVIF_TEXT;
tvi.hItem = hItem;
TreeView_GetItem(hTree,&tvi);
if ( tvi.lParam == 1 )
{
if ( hSkills == NULL )
hSkills =
CreateDialog(g_hInstance,MAKEINTRESOURCE(competences_cles),hWnd,(DLGPROC)Skills_Proc);
else SetFocus(hSkills);
}
...........
portion of code that catch the buttons selection:
case WM_COMMAND:
switch(LOWORD(wParam))
{
// the famous MENU_ITEM_2(dialog1)
if ( HWND(lParam) == (HWND)hJobsButton )
{
ShowWindow(hTree,SW_HIDE);
if ( hJobs == NULL )
hJobs = CreateDialog(g_hInstance,MAKEINTRESOURCE(emplois),hWnd,(DLGPROC)Jobs_Proc);
else SetFocus(hJobs);
}
// ***** MY PROBLEM MENU_ITEM_1(dialog2) *********
// *****************************************
if ( HWND(lParam) == (HWND)hMyResumeButton )
{
if ( hTree == NULL )
{
Create_Default_Tree(hWnd);
SetFocus(hTree);
}
else
{
ShowWindow(hTree,SW_SHOW);
SetFocus(hTree);
//TreeView_Select(hTree,hSkillsTree,TVGN_CARET);
//TreeView_Select(hTree,hItem,TVGN_CARET);
//SendMessage(hTree,TVM_SELECTITEM,TVGN_CARET,(LPARAM)hItem);
}
}
so can u help me please , i can't resolve it since a lot of time... :<
|
|
|
|
|
I am probably mangling my attempts at getting a PARAM value into my activeX control (MS VC++ 6).. I have set MayScript, etc. and the control works otherwise, But I can't figure out how to get the PARAM Values in... need simple strings available globally... An example project would be GREATLY appreceated!!!
|
|
|
|
|
// ----------- I declare a class constructor & destructor like this...
#include "afxdlgs.h"
class CEditSongListDialog : public CFileDialog
{
public:
CEditSongListDialog (BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL);
~CEditSongListDialog ();
...
}
// ---------- And define them like this...
CEditSongListDialog ::CEditSongListDialog (BOOL bOpenFileDialog,
LPCTSTR lpszDefExt,
LPCTSTR lpszFileName,
DWORD dwFlags,
LPCTSTR lpszFilter,
CWnd* pParentWnd)
:CFileDialog (bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
m_ofn.Flags |= OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_ALLOWMULTISELECT;
m_ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EDITSONGLIST);
m_ofn.lpstrTitle = "Edit Song List";
m_ofn.lpstrFilter = "*.MP3";
}
CEditSongListDialog ::~CEditSongListDialog()
{
UnhookWindowsHookEx (ESL_HookHandle);
nOnceOnly = 0;
}
// -------------- Then I get error message like this...
Compiling...
EditSongListDialog.cpp
Linking...
RR_SWallDlg.obj : error LNK2005: "public: virtual __thiscall CEditSongListDialog::~CEditSongListDialog(void)" (??1CEditSongListDialog@@UAE@XZ) already defined in EditSongListDialog.obj
Debug/RR_SWall.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
// ------------- The question is "what wrong with my program ???"
|
|
|
|
|
It's saying you have the CEditSontListDialog destructor defined in more than one place. The other place is in RR_SWallDlg.cpp (the file listed in the linker error).
--Mike--
http://home.inreach.com/mdunn/
Time is an illusion; lunchtime doubly so.
|
|
|
|
|
Hi.
I'm trying to improve a small dialog box which is part of a large program.
The list in the dialog box has been created using a SFTTree list control(Softelvdm Inc).
I'm trying to add a pop up menu when rightclicking within the list control, but have so far been unsuccessful at it.
I've tried to cut'n'paste code from a different non-SFTTree dialog box. Although the code seems to execute correctly (when tracing during debug), nothing happens. I've included the function with the code below.
void CAlarmEditPage::OnSFTTreeContextMenu(CWnd* pWnd, CPoint point)
{
TRACE("OnSFTTreeContextMenu()\n");
CMenu menu;
if(menu.LoadMenu(ID_POPUP_MENU)) // Use the What's This? Menu
{
CMenu* pPopup=menu.GetSubMenu(0);
pPopup->DeleteMenu( 0, MF_BYPOSITION ); //Remove "What's this"-Menu-item
pPopup->AppendMenu(MF_STRING, ID_HELP, "Help on selected alarm");
pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,this);
}
menu.DestroyMenu();
}
Is the code correct? Is there anything else which might cause the menu not to appear? All help greatly appreciated.
Regards,
Ole Chr. Birkeland
|
|
|
|
|
Hi,
I am thinking about a freeware application, that should be able to display and manipulate images. I've looked at the more famous libraries, such as ImageGear. Until I noticed QuickTime was free to use. Does anybody know a link with some sample-code how to use this? Or where I can download the SDK? (Didn't found it @ apple). Thanks!
--
Alex Marbus
|
|
|
|
|
Hi. I made an aplication chosing, in the step 5 in create proyect, the windows explorer option. Now i had a window wich on the left side there is a tree control and on the right i need a tab control or property sheet with pages and inside the pages an excell work-sheet. If there is anyone with a code with a similar aplicacion please send it to me or please help me to create one. I´m desperate! thanks.
|
|
|
|
|
hi,
I would like to change the caption of a button on a "open file dialogue". Do you know how to do it??
Thank you.
leonwoo
|
|
|
|
|
It's id is defined in dlgs.h and is something like btn1 or btn2. try GetDlgItem on different numbers working up until one works ;0)
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
check out http://www.codeproject.com/dialog/ddxfile.asp. This article by PJ Naughter does exactly what you want.
|
|
|
|
|
Hi
For a while now I've been looking for a image manipulation/processing control/DLL to add to our software. The three which have made it to my shortlist are VB Active DLLs. While writing some test applications I've noticed how much more difficult it is to write software for these in VC++ compared to VB. In particular:
1/ What takes 1 line of code in VB can take 10 or more in VC++, in setting up the correct argument types to pass to a function (eg SAFEARRAY, BSTR)
2/ Often having to pass all arguments to a function because VC++ doesn't seem to recognize default arguments?
3/ Having multiple pointers to the COM interface. eg. _ImagePtr, _ImageEffectsPtr, _ImageExportPtr, etc.
4/ A general decrease in software stability...
- Is there anyway to do this stuff with less stress in VC++? If not, is there anyway I can do this in a separate VB app and communicate with my software?
- From my limited experience ActiveX controls seem to be easier to use than VB ActiveX DLLs. Is there anyway to convert from the latter to the former? What is the point of ActiveX DLLs?
Thanks for your patience in reading my often confused ramblings
Regards
Brendan
|
|
|
|
|
Have you looked at Paintlib ? ( www.paintlib.de ) It's about to have a lot more image filter support ( I wrote it and will submit it shortly )
Christian
P.S. why the hell won't my home PC remember my login ?
|
|
|
|
|
Hi guys,
The problem:
In a dialog based app, blitting a bitmap into the dialog rect.
What I did:
In the constructor this:
HINSTANCE hInstance=NULL;
HBITMAP bitmap = (HBITMAP) LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BITMAP1));
m_Bitmap.Attach(bitmap);
--
In OnPaint() this:
//Create a compatible memory DC
CDC memDC;
memDC.CreateCompatibleDC(&dc);
CBitmap* pOld = memDC.SelectObject(&m_Bitmap);
//Select and realize the palette
CPalette* pOldPal = dc.SelectPalette(&m_Palette, TRUE);
dc.RealizePalette();
//BitBlt the bitmap to the screen DC
CRect rect;
GetClientRect(&rect);
dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(),
&memDC, 0, 0, SRCCOPY);
// Restore the DC's
dc.SelectPalette(pOldPal, FALSE);
memDC.SelectObject(pOld);
--
What is it I am missing? It's not showing up?
Thanyou.
|
|
|
|
|
Gosh, this is a long way around it. While it is always great to catch your old selected objects, in the case of a bitmap, the old one in a newly created DC is 1x1, and I believe the return you are getting may even be NULL. You're running on 256 color desktop ? I'm just wondering about the palette stuff, I've never had to bother.
Apart from that, I'd suggest doing it like this: ( taken from my code for an installer )
CDC memDC;
memDC.CreateCompatibleDC(NULL);
CBitmap Bitmap;
Bitmap.LoadBitmap(IDB_FRONTSCREEN);
memDC.SelectObject(&Bitmap);
CPaintDC pdc(this);
pdc.BitBlt(0,0,Bitmap.GetWidth(),Bitmap.GetHeight(),&memDC,0,0,SRCCOPY);
assuming that the bitmap is the same size as the window. I would tend nowadays to more generic code and write the stuff to figure out the stretchblt instead, because it leaves me able to change the image/dialog box size later with less hassle.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Am making a menu and so i need some way to launch a other program.
does ShellExecute do that?? If so how do i make it work, i tryed lots off things (didnt work)
Please give some examples.
Thank you
|
|
|
|
|
Yes, this is what you want. Here is the MSDN on ShellExecute.
ShellExecute
Performs an operation on a specified file.
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpVerb,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
Parameters
hwnd
Handle to a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.
lpVerb
A string, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's context menu are available verbs. For more information about verbs and their availability, see Object Verbs. See Extending Context Menus for further discussion of context menus. The following verbs are commonly used: Verb Description
edit Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail.
explore Explores the folder specified by lpFile.
find Initiates a search starting from the specified directory.
open Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder.
print Prints the document file specified by lpFile. If lpFile is not a document file, the function will fail.
properties Displays the file or folder's properties.
If you set this paramater to NULL:
For systems prior to Microsoft® Windows® 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used.
For Windows 2000 and later systems, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.
lpFile
Address of a null-terminated string that specifies the file or object on which to execute the specified verb. To specify a shell namespace object, pass the fully-qualified parse name. Note that not all verbs are supported on all objects. For example, not all document types support the "print" verb.
lpParameters
If the lpFile parameter specifies an executable file, lpParameters is an address to a null-terminated string that specifies the parameters to be passed to the application.The format of this string is determined by the verb that is to be invoked. If lpFile specifies a document file, lpParameters should be NULL.
lpDirectory
Address of a null-terminated string that specifies the default directory.
nShowCmd
Flags that specify how an application is to be displayed when it is opened. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it.
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the z-order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
Return Values
Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Microsoft® Windows® applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an integer and compare it with the value 32 or one of the error codes below.
0 The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ERROR_BAD_FORMAT The .exe file is invalid (non-Win32® .exe or error in .exe image).
SE_ERR_ACCESSDENIED The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE The file name association is incomplete or invalid.
SE_ERR_DDEBUSY The DDE transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL The DDE transaction failed.
SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND The specified dynamic-link library was not found.
SE_ERR_FNF The specified file was not found.
SE_ERR_NOASSOC There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM There was not enough memory to complete the operation.
SE_ERR_PNF The specified path was not found.
SE_ERR_SHARE A sharing violation occurred.
Remarks
This method allows you to execute any commands in a folder's context menu or stored in the registry.
To open a folder, use either of the following calls:
ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);
or
ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
To explore a folder, use:
ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
To launch the shell's Find utility for a directory, use:
ShellExecute(handle, "find", path_to_folder, NULL, NULL, 0);
If lpOperation is NULL, the function opens the file specified by lpFile. If lpOperation is "open" or "explore", the function will attempt to open or explore the folder.
With multiple monitors, if you specify the window handle and set lpOperation to "Properties", any windows created by ShellExecute may not appear in the correct position.
To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
See Also
IShellExecuteHook
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in shellapi.h.
Import Library: shell32.lib.
From my own code, it looks like this:
ShellExecute(this->m_hWnd,NULL,"IE.EXE",NULL,"IE5",SW_SHOWDEFAULT );
Note this was from an install CD, so I did not need to provide a path.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
First af all, please my ingles because i´m spanish girl. If you don´t understand me i can say someone to translate it and send to you again. I created a program which execute an unix script, i made this: system ("rsh dir_ip -l root -n path/namefile [parameter] -l") but before i had to modify rhost and another file in my unix machine. The system command give you the posibility to handle the DOS or windows commands as remote shell, now you have to research this commands.
|
|
|
|
|