|
You can download the stl source code from [^]
Since, this is your assignment, you should solve it.
HINT : check map.h and other files included in it.
|
|
|
|
|
It can vary from implementation to implementation but I believe that most use a balanced binary tree.
|
|
|
|
|
It all depends on the implementation. And anyway, if this is YOUR assignment, assigned by YOUR teacher, then YOU should be doing the work of finding out the answer, not asking someone else to do it - look at the source code.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The STL standard doesn't specify how a std::map is coded but rather its interface, which includes the complexity[^] of various operations. However, the complexity constraints and interface limit the choices. Generally a Red-black tree[^] is used.
Steve
|
|
|
|
|
I am currently developing application that plays videos for people in a simulator. The video player was developed by an old employee who has since moved on. The old developer used the elecard librarys/SDK to create the video player. The player works pretty good.
However, When I close the player and attempt to load another video the desktop is displayed for a short period of time. I tried to create a splash screen to hide the desktop using (CSplash - A Splash Window Class) project found on here. However, the splash screen stops working after new video player is loaded with file and ready to play in full screen. The splash screen window still exist in task manager but the screen is not visible and task manager says it;s not responding.
I tried to use tweakUI General, Focus, Prevent applications from stealing focus option. However that did not work Is there way to ensure, the splash screen is always on top?
Any help here would be great.
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
>> However, When I close the player and attempt to load another video the desktop is displayed for a short period of time.
why?????
> I tried to create a splash screen to hide the desktop using (CSplash - A Splash Window Class) project found on here. However, the splash screen stops working after new video player is loaded with file and ready to play in full screen. The splash screen window still exist in task manager but the screen is not visible and task manager says it;s not responding.
Your splash window is on same thread or a different one? may be your window is there but is not refreshed as your application thread is busy doing some other task.
Also, the idea of hiding desktop sounds like a quick, nasty fix. I hope it's not the case..
|
|
|
|
|
The placed the splash screen it's own application and it still failed after the video open full screen. I think the problem lies somewhere in video process feed of windows.
Scott
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
Hi. Well. I have a little problem, but i don't understand a thing. I'am trying to use some list in my class TLevel, but it always results in error (violation of memory). It's really simple.
I create my struct:
struct MyList
{
int numb;
MyList *Next;
MyList *Prev;
};
And include it in my class:
class TLevel
{
public:
bool LoadList(CString str);
MyList *Fieldlist;
bla-bla-bla
};
But as soon as i get into LoadList...
bool TLevel::LoadList(CString str)
{
MyList *HeadList;
HeadList = new MyList;
HeadList->Next=NULL;
HeadList->Prev=NULL;
this->Fieldlist=HeadList;
bla-bla-bla
}
|
|
|
|
|
I suppose you have a bla-bla-bla problem.
i.e. the posted code looks correct.
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]
|
|
|
|
|
CPallini wrote: I suppose you have a bla-bla-bla problem.
|
|
|
|
|
Cool. At least i know that i'am not crazy. Well. Here goes the rest of class TLevel.
class TLevel
{
public:
TLevel();
void CallBut(int xcoor,int ycoor,UINT nButton);
TLevel(int lvlsize, int sealvl);
~TLevel();
bool Generate(CWnd *dialog,int StartPointX = 0, int StartPointY = 0, int size = 50);
bool LoadList(CString str);
protected:
MyList* Fieldlist;
FieldStruct **map;
int LvlSize;
int SeaLvl;
int FieldSize;
int GetIndexX(int xcoor);
int GetIndexY(int ycoor);
};
I don't understand what can influence smthng so simple like Pointer1=Pointer2. It dosen't show any error. But as soon as i execute the code and it comes to this->Fieldlist=HeadList it raise a memory error (access violation). I'am desperate...
Oh yeah. And in constructor when i do smthng with Fieldlist it's ok. But when i get to LoadList function it crashes. Any idea?!
|
|
|
|
|
Nikz2 wrote: this->Fieldlist=HeadList; // an error appears. WHY HE CAN'T COPY A POINTER?!?!?!?!?!?
I just put your code into Visual C++ Express and it runs fine. There must be something else that you are not showing that causes the problem.
|
|
|
|
|
Well. I am sure that there has to be a thing, but i really don't even understand what could it be.. Any clue?
|
|
|
|
|
I found it!!! Cool. It was really simple.
TLevel *lvl = new TLevel(4,1);
CString str("C:\\FieldList.txt");
theApp.lvl->LoadList(str);
theApp.CreateLvl(lvl, this, 30, 30, theApp.FieldSize);
i make theApp.lvl inside of CreateLvl and at rate of LoadList it hadn't iniciated.
Thanks to all. It helped me a lot to understand that i am not crazy. Because i was really desperate =) thanks....
|
|
|
|
|
Is there some reason you're not using a standard container class - writing your own list makes absolutely no sense unless you're writing it to learn about things or because it's an assignment.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Well.. You see. It's just i tryed to use standart class and it resulted the same. I was thinking i use it wrong and for delete any doubt i wrote my own. It took me 10 minutes. And the problem and seeking for right code and examples took me hours. So sometimes it's more easy to use your own classes =)
|
|
|
|
|
Hi All Vc++ Programmers,
I have a strange issue with me.I have migrated one Application from vs-2003 to vs-2008 on Vista machine.When i enter a correct password it is getting logged in,but when i enter a wrong password the application gets crashed...I dont know how it is happening,,,,?
Why genarally exe crashes and if anybody having some idea please help me... I think it is a dll problem due to migration..?
modified on Friday, October 2, 2009 8:59 AM
|
|
|
|
|
When you log into Vista, your application crashes? If so, please explain the connection.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Was the application build with vs2003 ever ran on Vista ? or did you upgrade both OS and compiler at the same time ?
Is it possible your application is trying to access registry values without proper permissions ?
...
This signature was proudly tested on animals.
|
|
|
|
|
Dear Experts,
i could not able to build a following visual c++ code.can any one help me?
It shows can not open activeds.h
#define _UNICODE
#pragma comment( lib, "Activeds.lib" )
#pragma comment( lib, "Adsiid.lib" )
#include "stdafx.h"
#include <atlbase.h>
#include <activeds.h>
#include <cstringt.h>
#include <atlstr.h>
#include <comdef.h>
#include <Iads.h>
#include <Adshlp.h>
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
IADsContainer *pCont = NULL;
CoInitialize(NULL);
hr = ADsGetObject(L"WinNT://xxx.com/dc1.yyy.xxx.com", IID_IADsContainer, (void**) &pCont );
if ( !SUCCEEDED(hr) ) { return hr;}
_variant_t var;
IEnumVARIANTPtr pEnum;
ADsBuildEnumerator (pCont,&pEnum);
int cnt=0;
ULONG ulFetched = 0L;
_variant_t vChild;
while((SUCCEEDED(ADsEnumerateNext(pEnum, 1, &vChild, &ulFetched)) && ulFetched==1))
{
IADsUser* pADs;
hr = V_DISPATCH(&vChild)->QueryInterface(IID_IADsUser, (void**)&pADs);
if(hr!=S_OK)
break;
BSTR bstrName;
pADs->get_Name(&bstrName);
CString csName=bstrName;
SysFreeString(bstrName);
printf("%s\n",csName);
pADs->Release();
pADs = NULL;
}
// Cleanup.
if ( pCont )
{
pCont->Release();
}
CoUninitialize();
}
return 0;
}
|
|
|
|
|
raja 4 wrote: It shows can not open activeds.h
So does it exist? It should be part of the Platform SDK.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
you are using the following header files
#include "stdafx.h"
#include <atlbase.h>
#include <activeds.h>
#include <cstringt.h>
#include <atlstr.h>
#include <comdef.h>
#include <Iads.h>
#include <Adshlp.h>
Is it a small project?
does your application contains the activeds.h?
If your project does not contain any file,then only you will get this problem..First you look for this header file whether it is there in your appliation or not..?
|
|
|
|
|
Hi, I need to capture data (TEXT only) which is printed on a specified printer (no matter what is the type of printer).
I'm thinking about printer driver which will redirect print jobs to a real printer but this seems to be too complex.
May be nother solution exists (does it?). Could anyone tell me how can this be done in C++ or where can I read about this?
Thanks in advance
|
|
|
|
|
ibnhatab wrote: I need to capture data (TEXT only) which is printed on a specified printer (no matter what is the type of printer).
I don't think this is possible, either with C++ or any other language. Modern print functions do more than just write strings of text line by line to the device. They have to manage page positioning, headers and footers, etc.
Perhaps if you explain more of what you are trying to achieve we could offer some suggestions.
|
|
|
|
|
First of all I need to capture data which is going to be printed (no matter which format).
Getting TEXT only data is next step of this task.
Main task is to catch data which goes from a POS system to printer(usually TEXT only printer).
Thanks in advance.
|
|
|
|