|
Yes geo,
I will try it and get back to U.
Satya
|
|
|
|
|
Just started having to use C++ again after quite a bit of time of using Visual Basic, and going back is quite a pain.
I'm needing to zero-pad some hex output that my program spits out... problem is, I don't have a clue how to do it without using loops. Is there a simple way to zero-pad all information outputted by printf, or not?
|
|
|
|
|
|
Yep, that did it. Thanks a lot for the quick reply.
|
|
|
|
|
Hello all,
I would like to know how can I check whether the folder is exist or not? Which function should I use in visual C++? and which library should I included into my program?
Thanks!
Nachi
|
|
|
|
|
try using chdir function.
i.e., set the current directory to the required folder. if it fails then the folder does not exist (or atlease unusable)
|
|
|
|
|
_access() can Determine file-access permission.
Return Value
Each of these functions returns 0 if the file has the given mode. The function returns –1 if the named file does not exist or is not accessible in the given mode; in this case, errno is set as follows:
EACCES
Access denied: file’s permission setting does not allow specified access.
ENOENT
Filename or path not found.
Thinking in difference!
|
|
|
|
|
I like using _access() myself, but GetFileAttributes() is also available.
|
|
|
|
|
how to use WINDOWINFO ,I can not use it.
|
|
|
|
|
china_nn wrote:
I can not use it.
Because why? Are you receiving compiler, linker, or run-time errors? How about a small code snippet of what you have that is not working.
WINDOWINFO wi;<br />
GetWindowInfo(handle_to_some_window, &wi);
|
|
|
|
|
i want to synchronize the keyboard input of two windows.that is ,
i have two windows(window1 and window2).window1 is the top window on the desktop,window2 is behind window1. there is a edit control on both windows.
when i input char in the edit of window1.i want window2 change with window1.juse like i both input char in edit of window2.
the function AttachThreadInput seems to resolve my problem, but it does not work as i expected.
anyone can tell me other solutions.
here i should tell that window1 and window2 are in deffrent processes.window2 is an existent third-party program. i can do nothing about it.all i can do is in window1.
gucy
|
|
|
|
|
What about using some API calls to find the hWnd of the textbox in Window2. Take a look at:
- FindWindow
- GetDlgItem
Use it somewhat as follows:
HWND hMainWindow = FindWindow("[ClassName of main window]", NULL);
if(hMainWindow != NULL)
{
HWND hTextbox = GetDlgItem(hMainWindow, [ID of the textbox]);
...
}
You can find out the classname of the main window and the ID of the textbox using Greatis Windowse (google on it, I don't have the link just like that).
Once you figured out the hWnd of the textbox, you can use SetWindowText or a SendMessage WM_SETTEXT to put the text in the box in dialog 2.
Another option might be SetDlgItemText, but then you can't check the hTextBox hWnd to be valid or not before sending.
Good luck!
- Fahr
|
|
|
|
|
i want to synchronize the keyboard input of two windows.that is ,
i have two windows(window1 and window2).window1 is the top window on the desktop,window2 is behind window1. there is a edit control on both windows.
when i input char in the edit of window1.i want window2 change with window1.juse like i both input char in edit of window2.
the function AttachThreadInput seems to resolve my problem, but it does not work as i expected.
anyone can tell me other solutions.
here i should tell that window1 and window2 are in deffrent processes.window2 is an existent third-party program. i can do nothing about it.all i can do is in window1.
gucy
|
|
|
|
|
I download a software from:http://www.dachshundsoftware.com/download.html
It can defrag the Memory. How does it work?
Let's roll!
|
|
|
|
|
Eastdragon wrote:
How does it work?
By the simple and yet magical principle of snake oil.
Translation: It does not work.
|
|
|
|
|
But I used Windows Task Manager, I found the available Physical Memory really increased after Hare's defrag.
Why?
Let's roll!
|
|
|
|
|
what I know, some of these software tries to allocate a big blob of memory forcing windows manager to swap unused or less used memory pages to the swap file, which should teoretically make more physical space for the more active applications.
|
|
|
|
|
I have overriden the OnPaint function and I am using InvalidateRect to do some custom work in a section of the dialog. Is there any way to create the dialog so I have control over OnEraseBackground (there is none in the Class Construction - as far as I can tell) and can prevent the flicker. I know about double-buffering and I am basicly doing that but I am still getting a noticable flicker - I think because I cannot control the erase procedure. Thanks for any information.
|
|
|
|
|
|
Thanks for trying - but there is no WM_ERASEBKGND handler listed in the Class Editor - So I am guessing it will not operate properly without some extra work. OnEraseBkgnd is present in CWnd, CDialog base class, so it is a possibility.
|
|
|
|
|
You can add it yourself. In the class editor change the filter to Window and WM_ERASEBKGND will be in the list. I just tryied it with a blank dialog app, set a breakpoint in the OnEraseBkgnd() handler and it got there with no problem.
John
|
|
|
|
|
Hi i have a dialog box where i have enabled the scroll bars by using the horizontal and vertical scroll bar check boxes in the dialog properties box
my question is how do actualy get the scroll bars so i can control them etc
thanks
|
|
|
|
|
Hi,
I have enabled editing of the labels on the tree control and I want to see what user has edited in the label in the
OnEndlabeleditTree () function, so that I can either commit the change or, reject the change.
what should I use the check the user input in the label?
code:
void CGeneratorView::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
HTREEITEM hItem = pTVDispInfo->item.hItem;
if () //check edited text ?????????????????????????????
{
*pResult = TRUE;
}
else
{
*pResult = FALSE;
}
}
|
|
|
|
|
pTVDispInfo->item.pszText has the text, but if the user canceled the editing then it will be NULL. So you might do something like:
<br />
LPCTSTR lpszText = pTVDispInfo->item.pszText;<br />
if (lpszText != NULL && IsValidText(lpszText))<br />
{<br />
*pResult = TRUE;<br />
}<br />
else<br />
{<br />
*pResult = FALSE;<br />
}<br />
where IsValidText is some function you write to check the edited text.
|
|
|
|
|
from the code from MSDN i was able to open Excel and write to it. I would like a few more changes which I am not very sure as to how to implement .
1. How do i provide a fileName at the beginning instead of creating a new one and add data to a file . As of now I am creating a new WorkBook like
Workbooks books = app.GetWorkbooks();<br />
_Workbook book = books.Add(covOptional);
I want to be able to open an xls file as the current workbook and make changes to it !
2. I have a scenario where I have a lot of dynamic data in a tabular format(in a Grid control) in my Vc++ dialog application .I realise that I need to have a safearray , poplulate it with the data I need and then tie it to the range .
Do I have to precalculate the range that I am gonna be writing ? If yes then do I always need to Get a range using excel notation like
A-F ,AA-Af , BA-Bf and so on . That means that i might have to have some kind of mapping between my tables column number to the excel notation . Any efficient ways of doing this in case there is no other way out ?
if not i assume i can specify the range as absolute column numbers starting from 0 till the count of columns in the table i wish to export .
please advise .
|
|
|
|