|
CPallini wrote: Forum:Visual C++ / MFC
Subject:Repost.
Sender:CPallini
Date:Tuesday, September 30, 2008 2:59 PM
http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2743474[^].
Spying haan!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
if (!m_nwSplitter.CreateStatic (this, 1, 2)||
!m_nwSplitter.CreateView (0, 0, RUNTIME_CLASS (CNetworkTree),CSize (220,0), pContext))
{
return FALSE;
}
if (!m_nwSplitter2.CreateStatic(&m_nwSplitter, 3, 1,WS_CHILD | WS_VISIBLE| WS_BORDER,m_nwSplitter.IdFromRowCol(0, 1))||
!m_nwSplitter2.CreateView(0,0,RUNTIME_CLASS(CNetworkVwList),CSize(0,200), pContext)||
!m_nwSplitter2.CreateView(1,0,RUNTIME_CLASS(CSWPlanView),CSize(0,200), pContext)||
!m_nwSplitter2.CreateView(2,0,RUNTIME_CLASS(CTaskListView),CSize(0,0), pContext))
{
return FALSE;
}
before the code was like
CView * pane2 = (CView *)pNwViews>GetPane(0,1);
now i want to show one view in right panel ie in m_nwSplitter2.CreateView(0,0,...)..other in m_nwSplitter2.CreateView(1,0,...)..
i wrote like CView * pane2 = (CView *)pNwViews>GetPane(0,0);
but its not working...
plz help me...
thanx in advance..
|
|
|
|
|
|
Hi,
I have used TryEnterCriticalSection for thread synchronisation, It throws error during compilation,though i have defined the macro _WIN32_WINNT as 0x400 .
Please tell whether i need to do something more.
Thnaks
krishnan.S
|
|
|
|
|
Which version of visual studio are you using? If you are using VS6, you have to install the SDK to get those declaretions.
|
|
|
|
|
Ya iam using VS6 and I have installed SDK too.
|
|
|
|
|
ok.
Have you integrated the platform SDK with the VS6?I mean the include folders, lib folders etc.
If already integrated, ensure the SDK include folder is placed first in that list.
I hope you have set the _WIN32_WINNT macro in the project settings itself.
Also open the winbase.h file and ensure the function exists in that file.
|
|
|
|
|
macro should set to _WIN32_WINNT=0x0502 if it windows xp or make it >0x400 in the project settings itself.
|
|
|
|
|
Just a suggesstion, please don't flame me for this post. why don't you dynamically load the dll and call funcition from it. atleast your program would be compiled!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
Hi, I've had this problem before, and instead of trying to figure out which WIN32_WINNT blablabla is not set, I suggest you copy/paste the function declaration to the cpp file.
Add this in your cpp or header file:
extern "C"
{
WINBASEAPI
BOOL
WINAPI
TryEnterCriticalSection(
LPCRITICAL_SECTION lpCriticalSection
);
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for the reply it worked.
Can u please explain me the cause for this
|
|
|
|
|
krishnan.s wrote: Thanks for the reply it worked.
No problem
krishnan.s wrote: Can u please explain me the cause for this
Some version macro probably wasn't defined. This is a problem sometimes with VC6, I've found out that some things are missing because VC6 is too old.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi ....i am new to the Boost graph library. My query is, can i customise the adjacency list to take my class pointer as input.I dunnow if this a right section to post this question. Please do help me out if any of you know the answer.Thnx in advance.
|
|
|
|
|
I have an application which has a Dialog and a Tab control, each tab is a PropertyPage.
I don't have a OnInit handler for my Propertypages.
The situation I ran into is because I had to create a menu in the main dialog.
I have a Edit control and CComboBox in my Property page PPOne.
In my file menu, I do File Open, through which I can open a file and read its contents, am able to populate memory,then I perform the step m_oPPOne.Create(IDD_PP_ONE)(this is from a class derived from Ctabctrl) I see the tab appear, now how can I make the the data for the controls on this PP appear in their fields ?.
Example: Normally when I am on the PP if I click a button, this below function works fine.
void CPPOne::OnBtnRefreshClicked
{
UpdateData(TRUE);
CString str;
str.Format("%d",some_int1);
cs_my_edit_control = str;
UpdateData(FALSE);
ccb_my_combo_box.SelectString(0,*(&my_predef_Str[0+some_int2]));
}
But if I call this above function from my main dialog, it fails on the UpdateData line(s) with a assertion failure in line 4184 of wincore.cpp saying doing UpdateData before DoModal.
How can I overcome this? any suggestion would help.
Best Regards
RV
|
|
|
|
|
The details of your current problems can only really be fixed by you and a debugger.
Have a look at the code around the ASSERT - is it complaining that your calling UpdateData on a window that hasn't even been created yet? But if that's true, how can you get a button to be clicked unless it's on a valid window / dialog. Unless you are calling this method manually...
Which you say you are. At what point do you call the above function? Is it's before you have all the windows created, you'll be in trouble.
Etc.
You need to litter your code with breakpoints, and keep a very close eye on the m_hWnd member of your dialog and controls.
Iain.
|
|
|
|
|
you're right about that, the problem seems to be unique to this situation.
I am calling this function AFTER the tabs are created.
for whatever reason, the value passed to the function in wincore.cpp(just above line 4184) is a 1 when the error occurs, which suggests the data is being transfered from Screen/Dialogue to memory, while I am expecting it to go from memory to Screen.
But Thanks for the inputs....
Best regards
RV
|
|
|
|
|
UpdateData (BOOL bSaveAndValidate = TRUE)
It's not a spooky coincidence - you are calling it with true, which says "take values from screen, and put them into my variables".
But the other window creation stuff remains.
Iain.
|
|
|
|
|
The GetPrivateProfileString function strips leading whitespace. Is there an overload that doesn't, or will I have to write my own?
eg
[Example]
SomeValue=" foo bar baz"
(not code, but needed to preserve spacing)
I want to get the 6 leading spaces in front of foo in the buffer.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I believe this is by design of the ini "language"...
not sure, but i don't think you can have it without coding some stuff from your own...
|
|
|
|
|
I suspect toxxct is correct. But you may be able to get past the issue by using a special character (ie, '_') to replace the spaces.
Or maybe more cleverly, use UrlEscape function to replace spaces with %20, etc, and UrlUnescape to convert back again.
Iain.
|
|
|
|
|
I ended up using the former approach. UrlEscape probably would work as well, but would more significantly impact the ability of a user to edit the file.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
I build the dll that having a global variable. my requirement is to load the dll in
same application many times . every thing is fine but problem is that global variable using
copy the same value in all instances . how to avoid it . I must need that global variable.
Ashish
|
|
|
|
|
See here [^].
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]
|
|
|
|
|
|
Here's a solution I got from led mike: Use a class with a static member variable. It will be the same variable for all DLL instances.
|
|
|
|