|
Post a message on the board at the bottom of the article itself - that way the article author gets sent an e-mail, and may be able to help.
Dave
|
|
|
|
|
I'm stepping through the list of filenames retrieved fron the filedialog using GetNextPathName and GetStartPos, and for some reason it starts with the last file I selected (I'm doing a shift - click to select multiple files). Is this the expected behavior? THe order of selection is important to my app so I am wondering why it si starting from the last file selected....?
Appreciate your help,
ns
|
|
|
|
|
The first filename returned is the one that had the focus rect in the list, which will be the last name you clicked on.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Which comes first, the bug or the stress?" -- Chris Maunder
|
|
|
|
|
Ah I see. MAny thanks!
ns
|
|
|
|
|
I want to display a message box when the user closes the main view of a MDI framework, in order to let him know that every other view will be closed.
What method of the CScrollView derived class have I to ovveride?
Ive tried with OnDestroy, but I've seen that it's called after the window has been removed form the screen.
The OnClose method seems not to be called, as I've place a breakpoint in it.
Thanks!
|
|
|
|
|
I believe you need to handle OnCloseDocument() from with in the document not the view..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I don't think so, because I ant to check if I'm closing the main window, while other windows are still open. If I close the main view over a document, every other associated view must be closed.
|
|
|
|
|
When you say main window or view do you mean the whole application or just the active view in the application? I guess im not sure we are talking about the same thing.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Handle CMainframe::ID_FILE_CLOSE.
|
|
|
|
|
Override CDocument::CanCloseFrame() and return TRUE/FALSE if it's ok/not ok to close the frame window.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Which comes first, the bug or the stress?" -- Chris Maunder
|
|
|
|
|
Hi,
I using CListCtrl (VC++6.0) for a list of information, I do not have any problem to use the Mouse (or Right Click) to get information of a specific row ... by using:
<br />
int sel = m_browseW.GetNextItem (-1, LVNI_SELECTED);<br />
*) But when I use the Up/Down Keyboard (the 'highlite row' shift Up/DOWN) then I do not know which command I can try to read the new 'specific row'
Anyone can help?
Many thanks
|
|
|
|
|
Loop through the list and check the state of each row:
for (int iItem = 0, nItemCount = m_browseW.GetItemCount(); iItem < nItemCount; iItem++)
{
if (m_browseW.GetItemState(iItem, LVIS_SELECTED) & LVIS_SELECTED)
{
}
}
Regards,
Alvaro
That which does not kill me postpones the inevitable. -- despair.com
|
|
|
|
|
Hi,
I will try immediately!
Many thanks,
|
|
|
|
|
Hi,All
The following code giving me an error while running in Release Mode.
I tested this code under
Windows2000 professional,VC++6.0.
CMyDlg::OnButton()
{
BYTE byByteCmd;
CString strTemp;
char szVal[10];
szVal[0]='\0';
sprintf(szVal,"%d",1);
sscanf(szVal,"%X",&byByteCmd);
}
can any one tell me what is wrong with this code.
My observations:
1.If i commented CString strTemp---It is not giving any error
2.If this code running under Debug Mode--it is not giving any error
3.If this code running under Release Mode with TRy CATCH--it is not giving any error
TRY
{
BYTE byByteCmd;
CString strTemp;
char szVal[10];
szVal[0]='\0';
sprintf(szVal,"%d",1);
sscanf(szVal,"%X",&byByteCmd);
}
CATCH(CExPetion,expGen)
{
char szError[100];
exGen->GetErrorMessage(szError,100);
exGen->Delete();
}
END_CATCH
I am happiest man,If some one explain me step by step with this observations, why it is giving error in some conditions and not in another conditoions.
Thank in Advance
anju
|
|
|
|
|
try the following:
anju wrote:
char szVal[20];
|
|
|
|
|
Hi Alexo,
There is nothing in it r u Missed?
anju
|
|
|
|
|
Instead of sscanf(szVal,"%X",&byByteCmd); why not use atol() ?
What I think your code is doing is that you are reading an int value (%X) into a BYTE variable and overwriting the next location(s) in memory
you could try using %c
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
BYTE byByteCmd;
....
sscanf(szVal,"%X",&byByteCmd);
And types %X and %x require int or int alike (DWORD) argument, you are using byte.
1 byte vs 4 bytes... Due to debug mode padding you don't get an error.
|
|
|
|
|
Hi,
Thanks your comments.
but,what is the relation between " CString strTemp and sscanf(...)".
If i didn't used CString object this code doesn't give me an error.
regrads
anju
anju
|
|
|
|
|
Now this must be an old problem:
I have very big project that was originally meant solely for Linux.
I now port it also to windows (on the VC++ .NET) and apparently some DLLs call each other.
So, I face a linking problem as no .lib is available (the chicken and the egg problem).
Now this is a huge project. My options, as I see them are:
1) Take off all calls to imported functions inside some DLL, build it, build all rest the same way, then start bringing in the missing calls.
2) Use some sort of dummy lib. The problem is that if such an option really exist- I don't know how to do that.
3) Collide all DLLs into one.
I'll be glad to know if option 2 really exists, or of any other option if you see such.
Dynamically loading the DLL is as bad as option 1 as it requires many changes (each DLL exports hundreds of symbols), so I prefer to stick to the implicit load, and make as little source changes as possible.
Thanx for any help.
Elad.
|
|
|
|
|
Second option does exist - do not create complicated situations .
Is there any chance of isolating dependant functions into 3rd library?
|
|
|
|
|
Not really, this whole project is one big criss-cross...
If option 2 doesn't exist I tend to throw all code in just one big DLL...
|
|
|
|
|
How about 4th option screw static linking, and load dll(s) manually.
Or even have executable static linking DLL A, and dynamic DLL B. ( I hate static linking).
Brian
|
|
|
|
|
hey guys,
I am trying to retrieve the password of a specific user with the NetUserGetInfo function. But the MSDN says the following regarding the function:
--------------------
from msdn:
link: http://msdn.microsoft.com/library/d..._info_4_str.asp
The NetUserEnum and NetUserGetInfo functions return a NULL pointer to maintain password security.
--------------------
my code:
<br />
USES_CONVERSION;<br />
<br />
wchar_t *pswzUser = T2W("A");<br />
DWORD dwLevel = 4;<br />
USER_INFO_3 pUi;<br />
<br />
nStatus = NetUserGetInfo(NULL, pswzUser, dwLevel, (LPBYTE*)&pUi);<br />
return W2T(pUi.usri3_password);<br />
So how can I retrieve the password ???
da sonu
|
|
|
|
|
My application uses a tray icon, which can open a dialog only if asked by the user.
The rest of the time my dialog in the minimized state.
How can I remove the window from the task bar while my dialog is in minimized state so the user will only see the tray icon?
And how can I remove the menu that appears with the right click on the dialog’s icon (left top corner)?
|
|
|
|