|
As an advice if you have more than one dll loaded in ur application then you need to consider rebasing ur dll.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Hello guys,
I am encountering a problem with serveral ComboBox objects created directly from the resouce editior of my dialog-based program. The style is drop-down with a pre-entered set of data. The comboboxes in Windows XP would appear fine, clicking the arrow on the side will show a dropdown list displaying all the item strings. But when running the app in Windows 98, the dropdown list only extends to the height which just occupies the first item. I can, however, go through previous/next items by using the up/down arrow keys. Further, if I then enable "Vertical Scrollbar", a vertical scrollbar will now be available on the dropdown list, which I can use to go through the items. In Windows XP, enabling vertical scrollbar does not make any difference. Clicking on the arrow still gives the complete dropdown list.
I am not sure why it happens? Does it sound like IDE related issue? I am using .Net 2002
Please help,
thanks alot
|
|
|
|
|
hi
I think the problem is u didnt pull down the extent of ur combo drop down in the resource view, Go to your resource view,get the respurce where ur combo is,click on the dropdown arrow,u will get a dotted box, pull it down to the extent u want to display the data
When u do this, vertical scroll appears automatically...
Thanks
krithika
|
|
|
|
|
Thanks for the reply, krithika,
I go back to the resource view and indeed there are two different selection boxes, when you click on the combobox conetent location and the drop-down arrows. I have extended the drop-down view box and hopefully it will make a difference. Will report back. Assuming it works, why it doesn't cause a problem when the app is running on Windows XP?
|
|
|
|
|
J.B. wrote:
why it doesn't cause a problem when the app is running on Windows XP?
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Michael Dunn wrote:
The OS is compensating for the (very common) error of forgetting to set the combo box height properly.
That's exactly the mistake I made. Reszing Combobox's dropdown box height solves the problem in Windows 98.
Thanks guys
|
|
|
|
|
hi:
AS we know ,there are several CD_ROM track mode. The first one is CD_DA,The second one is MODE1 ,The last one is MODE2,which has two forms .
Who can help me?
Thank you very much.
|
|
|
|
|
I am writing an MFC dialog application where I have an edit box. If I know the start and end char's, what is the best way to get the substring? Any help is appreciated.
-Dev578
|
|
|
|
|
if you have the start and end indexes the use Mid()
str.Mid(start, end-start);
|
|
|
|
|
int begin = str.Find(char_begin);
int end = str.Find(char_end);
return str.Mid(char_begin + 1, char_end - char_begin - 1);
Robert-Antonio
"Life is very hard, if you apply E-R model to it."
|
|
|
|
|
I'm leaning English.I'm Korean.
I need that oldeDB use programming.
DB:MS-Access
language: visual C++ 6.0
I need sample code.
|
|
|
|
|
Check out the OLE-DB samples in MSDN, and the ATL support for OLEDB in ATLDBCLI.H
along with the online documentation for them.
They aren't (or should not be) specific to MS ACCESS, and have the advantage that they are reasonably lightweight compared to ADO.
Steve S
|
|
|
|
|
I am working on an on-screen keyboard replacement for Tablet PC's. I am using SendInput to send the characters. This works fine with "normal" windows. However, if a console window has the focus, it gets no output. I know that this can be done because the On-Screen Keyboard that comes with Windows XP does it. Can anyone point me in the right direction.
Thanks,
Dave
|
|
|
|
|
Check out MSDN.
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q190/3/51.asp&NoWebContent=1
Kuphryn
|
|
|
|
|
|
I have an application where I need to access the doc page and put data there from a function that is part of the mainframe.cpp file. I know how to access the doc page from the view...but I am not doing that in this application.
Also, can someone show me a simple SDI or MDI program where I can pass messages between classes, using handles to a class...forward referencing , etc, as is done in a typ C++ program with a main().
Thanks.
jerry1211a
jerry1211a
|
|
|
|
|
Hi jerry
here is the code to access doc page from mainframe.cpp
/////////////////////////////////////////////////////////////
//get main wnd handle
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
// Get the active MDI child window.
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
// or CMDIChildWnd *pChild = pFrame->MDIGetActive();
// Get the active view attached to the active MDI child
// window.
m_pView = (CTDGView *) pChild->GetActiveView();
m_pDOC = m_pView->GetDocument();
///////////////////////////////////////////////////////////
this code can be used from any part of the application to access a document.
Hope this helps
thanks
Krithika
|
|
|
|
|
I am having problem setting a dirty flag to a record (CRecordset). I am adding controls to the interface so that no updating to the database is allowed if the form has already been approved. So I did something like the code below. However, I always get the dialog saying "field is still dirty, do not know why". I am not expecting to see this dialog.
m_pSet->Edit();
m_pSet->UpdateData(TRUE);
if (m_pSet->IsFieldDirty(NULL))
{
If (m_pSet->m_is_approved == "1")
{
//reset the dirty flag
m_pSet->SetFieldDirty(NULL, FALSE);
AfxMessageBox("no updating is allowed on an approved application.");
if (m_pSet->IsFieldDirty(NULL) )
{
AfxMessageBox("field is still dirty, do not know why");
}
}
}
m_pSet->Update();
Elizabeth
|
|
|
|
|
Hi!
I've done a new Dialog Box in my application that appears when the user clicks a button in the main window. I need to know if the user has clicked one button in that Dialog box but I don't know how could I check this. I can check edit boxes or Radio Buttons if I see Dialog Box's int variables values from my main window code but I don't know what could I use for checking if buttons have been clicked or not. May I use a control variable or what could I do?
Thank you in advance!
|
|
|
|
|
All u need to do is create a member variable a bool type and set it true when the user has clicked on the desired button. Now that variable button has the state. You can either pass it as a parameter to the child window or read the value from the child window.
Hope this helps.
"When death smiles at you, only thing you can do is smile back at it" - Russel Crowe (Gladiator)
|
|
|
|
|
Yes, it's perfect. Thank you
|
|
|
|
|
I recently upgraded to Visual Studio 2003 from a version of Visual Studio .Net that is a few years old. After doing so, I converted an old (working) project file to the new version and tried to build.
I'm getting various versions of the same error, and I have no idea what's wrong. My only guess is that it has something to do with the inheritance from std::allocator in class_allocator. I realize its a rather long mess, but this is the first error straight from the build log.
Here's the error, which is basically repeated in various ways about 2000 times:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\map(25) : error C2248: 'class_allocator<type,blockCount,alignment>::rebind<U>::other' : cannot access inaccessible typedef declared in class 'class_allocator<type,blockCount,alignment>'
with
[
type=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>::value_type,
blockCount=256,
alignment=8,
U=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>::value_type
]
and
[
type=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>::value_type,
blockCount=256,
alignment=8
]
..\clientCommon\Allocator.h(76) : see declaration of 'class_allocator<type,blockCount,alignment>::rebind<U>::other'
with
[
type=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>::value_type,
blockCount=256,
alignment=8,
U=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>::value_type
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(23) : see reference to class template instantiation 'std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,_Mfl>' being compiled
with
[
_Kty=UString,
_Ty=ResObject *,
_Pr=std::less<UString>,
_Alloc=class_allocator<std::pair<UString,ResObject *>>,
_Mfl=false
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(65) : see reference to class template instantiation 'std::_Tree_nod<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(87) : see reference to class template instantiation 'std::_Tree_ptr<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(105) : see reference to class template instantiation 'std::_Tree_val<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\map(77) : see reference to class template instantiation 'std::_Tree<_Traits>
' being compiled
with
[
_Traits=std::_Tmap_traits<UString,ResObject *,std::less<UString>,class_allocator<std::pair<UString,ResObject *>>,false>
]
Shell\ResPool.h(71) : see reference to class template instantiation 'std::map<_Kty,_Ty,_Pr,_Alloc>' being compiled
with
[
_Kty=UString,
_Ty=ResObject *,
_Pr=std::less<UString>,
_Alloc=class_allocator<std::pair<UString,ResObject *>>
]
Here's the relevant code:
template< class type, size_t blockCount = 256, size_t alignment = 8 >
class class_allocator : public std::allocator<type>
{
public:
// All of this weirdness is required to make it stl compatible
template <class U> struct rebind { typedef class_allocator<U,blockCount,alignment> other; }; //!< Allow containers to manufacture notes containing node+this
template <class U> class_allocator(const class_allocator<U,blockCount,alignment>&) {} //!< Whatever sort of constructor, this eats them all to provide compatibility
class_allocator() {}
static type* allocate( size_t count = 1, void* = NULL ) { return (type*)pool_allocator<type, sizeof (type), blockCount, alignment>::allocate( count * sizeof (type) ); }
static void deallocate( void* p, size_t = 0 ) { pool_allocator<type, sizeof (type), blockCount, alignment>::deallocate( p ); }
static size_t GetBlockCount() { return pool_allocator<type, sizeof (type), blockCount, alignment>::GetBlockCount(); }
static size_t GetFreeCount() { return pool_allocator<type, sizeof (type), blockCount, alignment>::GetFreeCount(); }
static size_t GetInstanceCount() { return pool_allocator<type, sizeof (type), blockCount, alignment>::GetInstanceCount(); }
};
Does anyone have any idea what's wrong? If not, does anyone have any idea where I could look to find out?
Thanks,
Jon McClure
|
|
|
|
|
My first instinct on looking at the allocator was that most custom allocators I've seen don't inherit from std::allocator, and my second was that maybe throwing in a couple of 'typename's might make the problem go away - but that's a big guess - if my template code gets complicated enough to warrant that I've generally looked for a different approach .
I went through my bookshelf and found some material on writing custom allocators in:
"The C++ Standard Library: A Tutorial and Reference" - Nicolai M. Josuttis (good basic reference)
"Modern C++ Design" - Andrei Alexandrescu (Fixed size allocator + tricks)
"The C++ Programming Language" - Bjarne Stroustrup (pool allocator)
But you're right though, there isn't much good stuff on writing allocators.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Message Removed
modified 29-Jun-21 16:11pm.
|
|
|
|
|
I have a simple function:
void Cell::SetNumber ()
{
cout << "enter";
number= 1;
cout << "exit" ;
}
I get a segment fault after the "enter" prints, and it never seems to leave the routine.number is just an int. What should I suspect?
thanks,
ns
|
|
|
|
|