|
Requirement 3 would seem to limit you to flat ASCII files
that could be viewed/edited in Notepad or Wordpad.
You can then create an ODBC data source that will let you
manipulate the file via ODBC and satisfy that requirement.
Strange though. The requirements seem to have arisen from
different goals: hand editability and independence from
outside application vs. standardization of the interface
allowing substitution in the data source.
|
|
|
|
|
Tell me about it. My boss laid down the requirments at just the right level to be dangerous without exactly knowing what he wants. Now I am just researching what I can actually give and then counter proposal time...
If you start a fire for a man, he will be warm for a day. If you start that same man on fire, he will be warm for the rest of his life.
|
|
|
|
|
Just write to a plain ASCII text file.
It can be edited with notepad, wordpad, UltraEdit, ... you name it.
Then tell your boss that you use something like Online Dirty Binary Conversion (=ODBC) logic (or invent a nice acronym yourself).
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
I have a CListView where I want to set the top index explicitly.
How can I do that?
/Per
|
|
|
|
|
Here's one way to do it. I'm not sure why MS didn't include a SetTopIndex with the SysListView, but it seems silly...
void CYourListView::SetTopIndex( int p_iDesiredTopIndex )
{
CListCtrl & a_roList = GetListCtrl();
CRect a_oRect( 0, 0, 0, 0 );
a_roList.GetItemRect( 0, &a_oRect, LVIR_BOUNDS );
a_roList.Scroll( CSize( 0, p_iDesiredTopIndex * a_oRect.Height() ) );
}
Chris Richardson
|
|
|
|
|
Hello again,
I have a bunch of dialogs that I use as modals but I want to now bunch them together as child windows in one big dialog. In the process of doing this (without even getting to the make my dialog a child window yet), I am trying to alter the properties of my dialog at run-time. My problem is that when I change the properties by ModifyStyle() and ModifyStyleEx() it behaves (when I click the mouse etc..) as though the properties have changed but it still has the border and title etc. What am I doing wrong?
heres a snippet of the code thats causing the prob. I have tried all sorts of permutations and combinations of ModifyStyle(). It works if I change all the properties in the resource editor..
m_pProjInfoDlg = new CProjInfoDlg(this,m_pDoc);<br />
m_pProjInfoDlg->Create(IDD_PROJINFO,this);<br />
m_pProjInfoDlg->ModifyStyle(WS_POPUP|WS_CAPTION|WS_BORDER|WS_DLGFRAME|WS_THICKFRAME|WS_BORDER,0,SWP_NOACTIVATE);<br />
m_pProjInfoDlg->ShowWindow(SW_SHOW);
help!! Steadily going bananas.
thanks!
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I´m trying to convert a float to a char with the following code:
double Total;
char buffer[50];
Total = GetDouble(dbf, 2) + GetDouble(dbf, 3) + GetDouble(dbf, 4);
_gcvt(Total,10,buffer);
But the result is allways the same, even if the value of Total equals cero.
Can some body help me.
|
|
|
|
|
I think you probably want to be using sprintf(). See MSDN.
Signature space for rent. Apply by email to....
|
|
|
|
|
std::ostringstream could help you.
You can stream almost anything into it using operator<< and get the text using the ostringstream s str() function.
|
|
|
|
|
I have tried to test an application i have found into microsoft support, it's Q186120: "Use MFC to automate excel and fill a range with an array"
I have a problem when i try to run it at the following line:
saRet.PutElement(index, &d);
or
saRet.PutElement(index, v.bstrVal);
(it depends on checkbox is false or true)
when i try to debug it tell me that there's a problem in the function AfxCallWndProc.
So, i would like if someone have tested this application and if he could tell me what could be wrong?
thanks in advance
gerald
|
|
|
|
|
hey, in my program when someone hits the update button, it used to update but the UI would not respond etc. so i use a thread and it works good, but i set the waitcursor before i start the thread but it never stays up, any ideas on how to keep the curors as the wait cursor?
i have have this when the button is pushed:
CWinApp *pApp = (CWinApp*) AfxGetApp();
pApp->DoWaitCursor(true);
AfxBeginThread(startThread, this);
then when the thread is done it posts a message and then i set the cursor back to normal, but the cursor never changes, hope someone can help.
Also how do i go about making a button on the toolbar disabled?
thnkas
luke.
|
|
|
|
|
You will need to create an OnSetCursor handler for your main window that wants to set the wait cursor. You will want to create a variable that holds the current state that the cursor should be in. Then in your OnSetCursor function you should call ::SetCursor();
The reason that you need to do it this way is that every time you move the cursor over your window, a mouse message is generated, then a WM_NCHITTEST message is generated from that, and the WM_SETCURSOR message is then called to allow the mouse cursor to be updated when you move the cursor over the different regions in your window.
DoWaitCursor is only meant for a single function call, or single message handler where the operation could take a long time. However it does not work across message handling boundaries for the reason that I explained above.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
And its confounding me...
I have an array Arr in which I stored the values of 1 row of a database, and the size of this is the number of fields n. Now I want to send this off to a function in a parameter list like
myFunc(Arr[0], Arr[1], Arr[2],....,Arr[n-1])
I cant do a for n =0, n++ type loop since I need them all at once> So what is the way to go here?
Appreciate your help,
ns
|
|
|
|
|
why can't you just pass in the entire array to myFunc? Seems like that what you want....
Just trying to keep the forces of entropy at bay
|
|
|
|
|
The function demands that the parameters be fed in as I showed....I cant change that. Otherwise your idea is great!
Appreciate your help,
ns
|
|
|
|
|
does the function takes a limited or variable number of parameters?
i mean is it like printf ??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Nope, fixed number of variables
Appreciate your help,
ns
|
|
|
|
|
you could change it from this
myFunc(Arr[0], Arr[1], Arr[2],....,Arr[n-1])
to this
i=0 ;<br />
myFunc(Arr[i], Arr[++i], Arr[++i],....,Arr[++i])
I'm new here, pardon the n00bing
|
|
|
|
|
Thnaks. Welcome to CP
Appreciate your help,
ns
|
|
|
|
|
This doesnt work i fear cos i++ isnt yet evaluated
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hello!
first: i want to read a .txt file with visual c++. i know there something with fstream, iostram and so on. but i don´t know the details.
second: i want to read different txt files. if i press a button a dialog should open where i can choose a txt-file. how can i program this dialog???
thanks
sunny
|
|
|
|
|
re: first:
create an ifstream object
call open
set file pointer to end using seekg
call tellg to get the number of bytes in the file
allocate that number of chars
set file pointer to beginning using seekg
call read
call close
re: second:
use CFileDialog ... before calling DoModal, fill out the m_ofn structure in the CFileDialog object...
hope that helps...
Just trying to keep the forces of entropy at bay
|
|
|
|
|
i am trying to figure out if the user has 3 keys held down, if so i wanna popup my credits for my program.. the code i see referrences VK_CONTROL, VK_SHIFT, VK_ENTER, but what about normal letters? i tried to override OnKeyDown() but it never gets called.. here is what im using now:
BOOL CAboutDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_KEYDOWN)
{
BOOL bS = (GetKeyState(VK_ENTER) & 0x8000);
if (bS)
AfxMessageBox("ding!");
}
return CDialog::PreTranslateMessage(pMsg);
}
thanks for any suggestions!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
You can pass ASCII code to Get[Async]KeyState.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
i tried that.. i found an article on MSDN that said to do that.. i tried using 100 and 115 which are supposed to correspond to 'd' and 's'.. didnt wanna work.. i figured out something else that'll work tho.. thanks a bunch!;)
still a newb.. cut me some slack :P
-dz
|
|
|
|