|
It will be very much appreciated if someone can throw some light on this.
|
|
|
|
|
In previous versions, when I use dependencies and make a library project a dependency of another project, a link is added to the solution, and I can debug through the main project into the library. With VS2010, making the same dependency has no obvious effect on the solution. When I build the main project, the library is built, but is NOT included in the link. Seems trivial, but need help.
Related. When I want to add a library from another developer, I used to use 'Add existing'. This still works in VS2010, but .lib is not in the drop downs. What is the preferred method for doing this.
EJS
|
|
|
|
|
Hi Ed,
Those wacky folks at MS have changed the way dependencies are stored and used. Dependencies are now stored in the project file rather than the solution file. Please have a look here[^] - it's explained a bit better than I could, especially the section "Solution Dependencies into Project to project reference."
Hope that helps, at least to dig deeper,
Cheers,
Ash
modified on Tuesday, June 1, 2010 8:38 AM
|
|
|
|
|
Hi all,
I want to display a image in a particular control for this i have used CImage Class like this:-
CImage m;<br />
HRESULT hr=m.Load(Header_str);
But my problem is i am not getting how to show it in a particular control like static text box or picture control.
Thanks in advance
|
|
|
|
|
CImage class has already defined conversion operator to HBITMAP handle type so you can use in the same way like CBitmap class.See the documentation here
you have even example on hand.
Life is a stage and we are all actors!
|
|
|
|
|
learningvisualc wrote: But my problem is i am not getting how to show it in a particular control like static text box or picture control.
You need to use one of the drawing or 'blitting' methods to render the image onto your device context (window). See the options here[^].
It's time for a new signature.
|
|
|
|
|
Have you tried the CStatic::SetBitmap method.
You could use it like static.SetBitmap((HBITMAP)m) ;
|
|
|
|
|
Hi
How to replace occurance of one particular character in a string
For ex String str1 = "test_string_one"
In above string there are 3 occurance of character 't' at position 0,3 and 6
say i want to replace this 't' with 'z' so my string becomes as
"zesz_szring_one"
How to do it in C++ in one line without any looping or with looping
|
|
|
|
|
The CString class has a Replace method that will do this.
|
|
|
|
|
Replace(wchar_t oldChar, wchar_t newChar)
--
"Programming is an art that fights back!"
|
|
|
|
|
If you want to do it with standard C++ then use std::replace:
std::string str1( "test_string_1" );
std::replace( str1.begin(), str1.end(), '_', '-' );
FREX converts all the underscores to dashs.
Cheers,
Ash
|
|
|
|
|
Hi,
In my MDI application,i have one Group view with more No of views.I will get every page by using PageUp and PageDown.
So i coded in OnKeyDown() to get this function.
But when i press PAGEDOWN or PAGEUP,it doesnot go to that function part.But when i press like
SHIFT+PAGEDOWN it works.
So i use PreTranslateMsg() coding,i copied same coding form OnKeyDown(),but when i press PAGEDOWN it works but it move to 3rd page not 2nd page.It goes like 3,5,7 page.
When i use Mouse roll it works fine in OnKeyDown().
void CGroupView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if(nChar == 17)
return;
BOOL bMax;
CView *curView;
CMDIFrameWnd *fWnd = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *fChWnd = fWnd->MDIGetActive(&bMax);
if(fChWnd->GetSafeHwnd())
curView = (CView *)fChWnd->GetActiveView();
else
curView = NULL;
switch(nChar)
{
case 33:
{
giGrPNo--;
if(giGrPNo<1)
giGrPNo=1;
else
{
Invalidate(FALSE);
}
iTagNo = -1;
break;
}
case 34:
{
giGrPNo++;
if(giGrPNo > iGrpCnt)
giGrPNo = iGrpCnt;
else
{
Invalidate(FALSE);
}
iTagNo = -1;
break;
}
}
BOOL CGroupView::PreTranslateMessage(MSG* pMsg)
{
UINT nChar = (UINT)pMsg->wParam;
UINT nKeyDown = (UINT)pMsg->lParam;
<..Same coding from OnKeyDown()..>
}
When i press PAGEDOWN it should go to that function part.What can i do?
Anu
|
|
|
|
|
Anu_Bala wrote: So i use PreTranslateMsg() coding,i copied same coding form OnKeyDown()
Possibly you should move the 'same coding' from OnKeyDown to PreTranslateMsg .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Ya,
i moved everything form OnKeyDown() to PreTranslateMsg().
It works when i press PAGEDOWN,but it not goes to second page,directly to 3rd page.again if i press PAGEDOWN,it goes to 5th page not to 2nd page.
Anu
|
|
|
|
|
I doubt View switching might be called more than once.
Try using WM_KEYUP
Check documentation for WM_KEYDOWN:
Because of auto-repeat, more than one OnKeyDown call may occur before an OnKeyUp member function call is made. The bit that indicates the previous key state can be used to determine whether the OnKeyDown call is the first down transition or a repeated down transition.
--
"Programming is an art that fights back!"
|
|
|
|
|
I have an application which ejects a USB by CM_Query_And_Remove_SubTree API, but it returns 0x17( CR_REMOVE_VETOED ) error code in XP SP3. But it works fine in XP SP2.
Also please note the below case:
In XP SP3, after I plugged the USB first time after machine start, the USB displayed in explorer, but not able to create/copy a folder\fine into the USB drive.
I have checked with other xp sp3 machine also... issue exists. If I unplug and plug the USB manually then it works. But it works fine in XP SP2 machines.
Could any one please let me know why this issue occurs in xp sp3?
aks
|
|
|
|
|
Hi all,
I want to open a URL(http://10.14.15.23/test/test.aspx) which is present in the server.I am using the following code.
CInternetSession objInetSession;
try
{
CStdioFile* objStdFile = objInetSession.OpenURL("http://10.14.15.23/test/test.aspx",1,INTERNET_FLAG_TRANSFER_ASCII ,NULL,0);
}
catch(CInternetException* exp)
{
exp->GetErrorMessage(lpErr,sizeof(lpErr),NULL);
::AfxMessageBox(lpErr,MB_ICONSTOP);
return 0;
}
Everything is working fine. But, the server local user account, which is configured in IIS for anonymous access, gets locked frequently. So, i am not able to access this link.
Server machine has a policy that if we enter wrong password for more than 4 times while logging,the user account will get locked.
Can anyone please tell me the reason for this user account lock?
Thanks,
modified on Tuesday, June 1, 2010 2:54 AM
|
|
|
|
|
Use either Netmon or Wireshark to capture the network traffic to make sure the credentials are NULL.
Check the IIS log files and look for the 403 responses as these should contain the credentials that were actually used for the request.
However the first thing to check is the application pool the ASPX is running in and what credentials the server will use to run the request.
If you enable auditing on the test.aspx file you will see from the security event log which credentials are being used.
Put simply the site you have created is not as anonymous as you think so always check with a browser first before coding against it. If you cannot access the link then how is your code.
hope that helps.
Alan
|
|
|
|
|
No i just want to know that system user account lock issue is bcoz of this code?
|
|
|
|
|
Enable auditing. It is the only way...
This should help but if you search the Microsoft KB for "Account lockout" there are plenty of instructions on how to do it.
http://support.microsoft.com/kb/921469[^]
Alan
|
|
|
|
|
HI,
Please clarify my doubt.
How many maximum Documents and View will be available in SDI ?
How many maximum Documents and View will be available in MDI ?
Thanks,
Krishna
|
|
|
|
|
The number of documents and views are limited only by memory.
The documents and its views in an MFC application are stored internally in linked lists.
So you shouldn't worry about this.
If you have reached the limit and are unable to add more, there is something seriously wrong with the program and needs a re-design.
|
|
|
|
|
That's true for MDI but for an SDI, you only have one document.
|
|
|
|
|
Thanks Cédric,
1.In SDI only one Document will be there or one Document at a time we can load ?
2.How many views in SDI is one View or Many ?
Thanks,
Rayalu
|
|
|
|
|
1. I don't get your question. In a SDI application, you can only have one document loaded at a time in memory. Of course, you can load another document but then the old document is replaced by the new one. You always work with only one document. Does that answer your question ?
2. As many as you like (and what the memory allows).
|
|
|
|