|
Hey all. This is a simple question.
I have an array I want to iterate. Its in a for loop, and each item of a 3-Dimensional array needs to be assigned a string from an input file. Unfortunately, I keep getting errors when trying to put a string in an array index. I use this line:
inFile.get(ID[i][0], 7, '|');
ID is the array and i is the for loop index. Here's the error:
error C2664: 'class istream &__thiscall istream::get(char *,int,char)' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
I've looked up the error and read everything from arrays to pointers to indexing to mountain goats and can't find the right way to do this. I'd appreciate any help. Thanks.
-Tony
|
|
|
|
|
The error says you're passing a char where a char* is expected. So something's amiss with the expression "ID[i][0]". It looks like your declaration or usage of the ID array is wrong. It's a 2D array of chars, not 3D, since 2 dereferences result in a char.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Hi,
I have been told that I can create a windows 2000/nt service which will allow my to communicate with the user via dialog boxes.
How can I get the driver to make the service display a dialog and how does the driver retrieve what the user enters?
thanks
|
|
|
|
|
You *can* do that if you check the "Allow service to interact with desktop" in the services settings...
But I would not recomend that, services is not made to be GUI apps. Why not make a GUI-thing that talks with the server, using Named Pipes, Sockets or something else...
How can I get the driver to make the service display a dialog
What driver?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi!
I would like to have a small strip on the left in my SDI app. The strip should go all the way from the titlebar down to the window limits. How can I make the menus and toolbars move with respect to this strip, preferably implemented as a CView-derived object. Anyone who knows an example or something?
|
|
|
|
|
Hi,
I would like to be able to read the tag format that WMA files uses to store information about the particular track. It works a little like ID3 but of course it is slightly different. It looks like the data is stored towards the beginning of the file rather than the end.
There are functions in the windows media SDK to do it but this involves linking in to a pretty big library for what is a simple operation.
Does anyone know how to do this simply?
James
James
|
|
|
|
|
If it's just text like ID3, then the different fields are at specific locations, so open the file, read the bit required and parse it into it's relative bits.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
hello, i would like to know how can i retrieve information inside a listctrl when the item has been selected by a checkboxes in a table,
Thanks in advance
Mag
|
|
|
|
|
I have a dialog based app and I have to handle WM_CHAR messages in it. The problem is, these messages get sent to the buttons and not the CDialog object.
How can I redirect?
Thank You
LP
|
|
|
|
|
Override PreTranslateMessage in your dialog class.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
|
|
I know, PreTranslateMessage.
But, What do you mean ?
You mean, i can use WM_CHAR message in PreTranslateMessage ???
Or no ? use PreTranslateMessage itself ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have created a number of Active X controls useing MFC and I have tested them in the Active X control Container and they work fine - but when i try to get them to work in IE they don't seem to work.
Does anyone have any examples of what needs to be done to get the active x control to work in IE?
thanks
|
|
|
|
|
What do you mean they don't work? They don't load? IE shows an error message? IE formats your hard drive?
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
I'm working with really simply stuff, I'm just following a text bok word for word mouse click for mouse click, and it works exatcly fine in Active X control container. but I've tried to get them to work in IE but they won't
what happens in IE is -
the box where the control should be is shown with a picture symbol
then the page is loading
then the control just stops with out displaying anything and a red x symbol is shown
I'm placed an AfxMessgaeBox call in the InitInstance function and it gets called! in IE. but the OnDraw methode doesn't seem to be called before it stops.
Does any one a simple control that is useing MFC and works in IE. I even just run the Active X wizard in VC++ 6.0 and complied. ran fine in Active X control Container but same result in IE. Please help? I'm totally stuck.
|
|
|
|
|
I have placed TVINSERTSTRUCT as a memeber in a self-defined struct, as follows:
struct MyStruct
{
int data;
TVINSERTSTRUCT tvins;
// etc...
}
When the user clicks on button A, and having selected a particular tree item, i want to amend the value of the member 'data' which is in the same struct as the selected tree item.
I tried to use GetSelectedItem(), bt it returns a HTREEITEM. How do i know which node doe sit belong too?
Thanks in advance.
|
|
|
|
|
I think you are thinking about it backwards. It is probably easier to add your data to the TreeView items. You can accomplist this by using the lParam in the TVITEM. Whenever an item is selected, handle the TVN_SELCHANGED message for your treeview and retrieve the data and modify accordingly.
Mike
Some Code follows:
HTREEITEM tvAddItem( HTREEITEM hParent, LPSTR szText,
HTREEITEM hInsAfter, int iImage,
LPVOID pvData ) // pvData would just be your MyStruct *
{
HTREEITEM hItem;
TVITEM tvI = {0};
TVINSERTSTRUCT tvIns = {0};
// The pszText, iImage, and iSelectedImage members are filled out.
// make sure we set the flag for TVIF_PARAM
if( iImage == -1 )
{
tvI.mask = TVIF_TEXT | TVIF_PARAM;
}
else
{
tvI.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
}
tvI.pszText = szText;
tvI.cchTextMax = lstrlen (szText);
tvI.iImage = iImage;
tvI.iSelectedImage = iImage;
tvI.lParam = (LPARAM) pvData;
tvIns.item = tvI;
tvIns.hInsertAfter = hInsAfter;
tvIns.hParent = hParent;
// Insert the item into the tree.
hItem = TreeView_InsertItem( iv_ctlTreeView.m_hWnd, &tvIns );
return( hItem );
}
// update the data from the TreeView in the SELCHANGED event
// selchange WM_NOTIFY, TVN_SELCHANGED
LPNMTREEVIEW pnTree = (LPNMTREEVIEW) lParam;
MyStruct *pMyStruct;
pMyStruct = (MyStruct *) pnTree->itemNew.lParam;
|
|
|
|
|
I'm using the IE COM object in a program I'm writing, but I'm using it mostly to display files and folders in the user's file system. It's working well except for one problem: there's no way that I can find to set the view style (e.g. List/Icon/Report/Small Icon). Is there any programmatic way of doing this?
Thanks,
Karim
|
|
|
|
|
Sorry for the obvious question, but if you're writing an application presumably in MFC??, and all you care about is files and folders, you should be using the Common Control, CFileDialog.
If you truly WANT to use the IE COM object for this... well, I've never done that but I imagine it closely resembles the MFC object, CWebBrowser. I'd look into that.
|
|
|
|
|
I use the IWebBrowser interface as an ActiveX control to view the files(their contents), and I don’t know how to get hold of its(WebBrowser) automation servers history list, not just navigation through the GoForeward, GoBackward. Also the applications run as not the COM servers.
Thanks, Alexandre
Software developer
|
|
|
|
|
Hi,
I am having this error after compiling the program at line:
rsTemp->Open (SourceTemp, Connect, adOpenForwardOnly, adLockReadOnly, -1);
OR
rsTemp->Open (SourceTemp, Connect, 0, 1, -1);
does anyone know how to repair it?
I am using #import "msado15.dll" and _COM_SMARTPTR for _Recordset
I have the SAME code in other testing program and it works fine. Why ?
thank you
|
|
|
|
|
the problem was in stdafx.h -- after dropping these two lines:
#include "afxdb.h"
#include "afxdao.h"
program works.
|
|
|
|
|
Hi,
I have a question.
How can i have the option of viewing my bmp image in different sizes. (twice as big, tripple,..)
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
Use StretchBlt.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|