|
This way if i set to NULL, i get a blank command icon displayed in the Title of the dialog.
However, in the taskbar still the icon is present.
I dont want the icon or even like a blank command type of icon displayed on the Dialog title.
So please suggest some other way.
Priya Sundar
|
|
|
|
|
Hello,
i did not try, but putting a transparent icon (only transparent background) which has nothing on it may solve your problem .
Bekir.
|
|
|
|
|
Good suggestion!
Thanks.
But in this case I need to allign the title bar text to the right of the dialog.
I am not sure how to do this!
Any suggestion for this?
Priya Sundar
|
|
|
|
|
Hello,
Right click on the dialog, go to Properties then Select Right Align Text in the misc. category
It does change where the title bar is located, but not sure that is exactly what you need.
Hope this helps.
Bekir.
|
|
|
|
|
How to create Win32 DLL using VC++ .Net?
There is no icon for this in the "New Project" dialog..
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: There is no icon for this in the "New Project" dialog..
Select "Win32 Project" option. Click "Ok" and in next dialog select "Application Settings" tab and there you have radio buttons for "Dll" and "Static library"
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
In VC++ 2008, I import some classes from excel.exe (office 2003), and include them as below:
#include "CApplication.h"
#include "CWorkbook.h"
#include "CWorkbooks.h"
#include "CWorksheet.h"
#include "CWorksheets.h"
#include "CRange.h"
When compiling, there are hundreds of errors.
Google says that there should be another file like excel8.h/excel9.h. But it isn't generated, what's the problem?
system
|
|
|
|
|
You are using the wizard to import all these classes or not? If you are using the wizard then all the headrers file will be added automaticlally. I do not know in 2008 how you will use the wizard, but exploring a little I suppose you will get it.
|
|
|
|
|
My program must place words in alphabetical order and print the lines that each word appears on. So if "a" appears twice on line 1, once on line 2, and 3 times on line 3. The output should read: a: 1 1 2 3 3 3.
So I need help in coming up w/ a sorting algorithm that does this. Can someone one please help me?
This is my code:
// Example of Binary Search of an Array
#include <iostream>
#include <cstdlib>
#include <string>
#include "queue.h"
#include <sstream> // for istringstream
using namespace std;
const int MAX = 200; // maximum number of nodes
typedef string TreeItemType;
/*
class TreeNode { // node in the tree
private:
TreeNode();
TreeNode(const TreeItemType& nodeItem,
int left, int right);
TreeItemType item; // data portion
int leftChild; // index to left child
int rightChild; // index to right child
// friend class - can access private parts
friend class BinaryTree;
}; // end class TreeNode
//int values[] = { -23, -6, 10, 15, 20, 25, 32, 40, 55, 82, 90, 100 };
TreeNode values[MAX];
*/
typedef struct dictType{
string str;
Queue line;
}dictItemType;
const string Punctuation = ",.;:?\"'!@#$%^&*[]{}|";
int main () {
//int sizeValues = sizeof(values) / sizeof (int);
istringstream strLine;
string line, word;
//dictItemType dict;
dictItemType dictionary[200];
int currentLine=0;
int j;
while (getline(cin,line)) {
++currentLine;
// clear the strstream and copy the entered line to it
strLine.clear();
strLine.str(line);
// now get each word-sequence from the strLine stream
while (strLine >> word){
//dictionary[i].str = word;
//You need tokenized.
while (word.length() > 0 && Punctuation.find(word[0]) != string::npos)
word = word.substr(1);
for( j=0; j < MAX; j++){
if(dictionary[j].str.empty()){
cout << currentLine << ": " << word << endl;
dictionary[j].str = word;
dictionary[j].line.enqueue(currentLine);
break;
}else{
if(dictionary[j].str.compare(word) == 0){
cout <<"Already there"<<endl << currentLine << ": " << word << endl;
dictionary[j].line.enqueue(currentLine);
break;
}//endif
}//endifelse
}//endfor
//j=0;
}//endwhile
}//endwhile
//SORTALGORITHM
// ********************************************************
// Header file queue.h - Pointer-based implementation.
// ********************************************************
typedef int QueueItemType;
class Queue {
public:
// constructors and destructor:
Queue(); // default constructor
~Queue(); // destructor
// Queue operations:
bool isEmpty();
// Determines whether the queue is empty.
// Precondition: None.
// Postcondition: Returns true if the queue is empty;
// otherwise returns false.
void enqueue(QueueItemType newItem);
// Inserts an item at the back of a queue.
// Precondition: newItem is the item to be inserted.
// Postcondition: If the insertion is successful, newItem
// is at the back of the queue.
bool dequeue();
// Dequeues the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, the item
// that was added to the queue earliest is deleted
// and returns true; if queue is empty, returns false
bool dequeue(QueueItemType& queueFront);
// Retrieves and deletes the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, queueFront
// contains the item that was added to the queue
// earliest, and the item is deleted and returns
// true; if queue is empty, returns false
bool getFront(QueueItemType& queueFront);
// Retrieves the item at the front of a queue.
// Precondition: None.
// Postcondition: If the queue is not empty, queueFront
// contains the item that was added to the queue
// earliest and returns true; if queue is empty,
// returns false
private:
// The queue is implemented as a linked list
// with one external pointer to the front of the queue
// and a second external pointer to the back of the
// queue.
struct QueueNode {
QueueItemType item;
QueueNode *next;
}; // end struct
QueueNode *backPtr;
QueueNode *frontPtr;
}; // end class
// *************************************************************
// Implementation file queue.cpp - Pointer-based implementation
// *************************************************************
#include "queue.h" // header file
Queue::Queue() {
backPtr = frontPtr = NULL;
} // end default constructor
Queue::~Queue() {
while (!isEmpty())
dequeue();
} // end destructor
bool Queue::isEmpty() {
return backPtr == NULL;
} // end isEmpty
void Queue::enqueue(QueueItemType newItem) {
// create a new node
QueueNode *newPtr = new QueueNode;
// set data portion of new node
newPtr->item = newItem;
newPtr->next = NULL;
// insert the new node
if (isEmpty()) // insertion into empty queue
frontPtr = newPtr;
else // insertion into nonempty queue
backPtr->next = newPtr;
backPtr = newPtr; // new node is at back
} // end enqueue
bool Queue::dequeue() {
if (isEmpty()) return false;
// queue is not empty; remove front
QueueNode *tempPtr = frontPtr;
if (frontPtr == backPtr) { // special case?
// yes, one node in queue
frontPtr = NULL;
backPtr = NULL;
}
else frontPtr = frontPtr->next;
tempPtr->next = NULL;
delete tempPtr;
return true;
} // end dequeue
bool Queue::dequeue(QueueItemType& queueFront) {
if (isEmpty()) return false;
// queue is not empty; retrieve front
queueFront = frontPtr->item;
dequeue(); // delete front
return true;
} // end dequeue
bool Queue::getFront(QueueItemType& queueFront) {
if (isEmpty()) return false;
// queue is not empty; retrieve front
queueFront = frontPtr->item;
return true;
} // end getFront
// End of queue.cpp
Princess Angel
|
|
|
|
|
Please:
1. use code block button to surround code snippets with <pre> tags.
2. elaborate, stating clearly:
- What you need.
- What you have accomplished so far with your code.
- What is the problem you're experiencing.
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]
|
|
|
|
|
if a struct is like following:
typedef struct _test_struct
{
int a;
int b;
int c;
}test_struct;
in C99 standard, if we want to define a global such struct with some initialized value(we only want to initialize b to 10), we can write this code like:
test_struct global_obj = { .b = 10};
but how to do the same thing in VC2005? Thanks
|
|
|
|
|
Just initialize all three members:
test_struct global_obj = { 0, 10, 0 };
(That's what it's actually doing in C99, so why pretend otherwise )
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
When I try to compile the program in the URL:
How to: Marshal ANSI Strings for ADO.NET[^] there is error in command prompt:
"cl is not recognized" as an internal or external command operable program or batch file.
How to compile this program?
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
You should issue the command line form the console open by means of the Visual Studio Command Prompt . For instance, using Visual Studio 2005 , select
Start->Programs->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt menu item and then use the just appeared console window to write the command line.
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]
|
|
|
|
|
Following is the simple code of my application...
#include "stdafx.h"
#include < iostream >
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << "Hello World!\n";
return 0;
}
The out put of this program on console is as follows:
The system cannot execute the specified program.
Press any key to continue...
Mohsin Ali
|
|
|
|
|
Are you compiling for the correct platform?
|
|
|
|
|
Hi guys,
I've been working on my Linked List implementation and have run into some troubles. There is an easy solution (more on this later) but the problem is, it's a messy solution.
When I compile my project I get the following errors:
<project name="">\LinkedTileList.h(17) : error C2061: syntax error : identifier 'Tile'
<project name="">\LinkedTileList.h(24) : error C2061: syntax error : identifier 'Tile'
<project name="">\LinkedTileList.h(26) : error C2061: syntax error : identifier 'Tile'
<project name="">\LinkedTileList.h(29) : error C2143: syntax error : missing ';' before '*'
<project name="">\LinkedTileList.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<project name="">\LinkedTileList.h(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<project name="">\LinkedTileList.h(38) : error C2061: syntax error : identifier 'Tile'
<project name="">\LinkedTileList.h(48) : error C2061: syntax error : identifier 'Tile'
<project name="">\LinkedTileList.h(59) : error C2061: syntax error : identifier 'Tile'
</project></project></project></project></project></project></project></project></project>
It doesn't recognise my Tile class from within the Node class of my linked list.
Here is LinkedTileList.h
#pragma once
#ifndef INC_LINKEDLIST_H
#define INC_LINKEDLIST_H
#include "Globals.h"
class Node;
class HeadNode;
class TailNode;
class InternalNode;
class Node
{
public:
Node();
virtual ~Node();
virtual Node * Insert(Tile * theTile)=0;
private:
};
class InternalNode: public Node
{
public:
InternalNode(Tile * theTile, Node * next);
virtual ~InternalNode();
virtual Node * Insert(Tile * theTile);
private:
Tile * myTile;
Node * myNext;
};
class TailNode : public Node
{
public:
TailNode();
virtual ~TailNode();
virtual Node * Insert(Tile * theTile);
private:
};
class HeadNode : public Node
{
public:
HeadNode();
virtual ~HeadNode();
virtual Node * Insert(Tile * theTile);
private:
Node * myNext;
};
class LinkedTileList
{
public:
LinkedTileList();
~LinkedTileList();
void Insert(Tile * theTile);
private:
HeadNode * myHead;
};
#endif
LinkedTileList.cpp
#include "Globals.h"
#include "LinkedTileList.h"
InternalNode::InternalNode(Tile * theTile, Node * next):
myTile(theTile), myNext(next)
{
}
InternalNode::~InternalNode()
{
delete myNext; delete myTile;
}
Node * InternalNode::Insert(Tile * theTile)
{
myNext = myNext->Insert(theTile);
return this;
}
Node * TailNode::Insert(Tile * theTile)
{
InternalNode * dataNode = new InternalNode(theTile, this);
return dataNode;
}
HeadNode::HeadNode()
{
myNext = new TailNode;
}
HeadNode::~HeadNode()
{
delete myNext;
}
Node * HeadNode::Insert(Tile * theTile)
{
myNext = myNext->Insert(theTile);
return this;
}
LinkedTileList::LinkedTileList()
{
myHead = new HeadNode;
}
LinkedTileList::~LinkedTileList()
{
delete myHead;
}
void LinkedTileList::Insert(Tile * pTile)
{
myHead->Insert(pTile);
}
Tile.h
#pragma once
#ifndef INC_TILE_H
#define INC_TILE_H
#include "Globals.h"
static int NumTiles = 0;
static int * p_iNumTiles = &NumTiles;
class Tile
{
public:
Tile(void);
~Tile(void);
float GetLeft(void);
float GetTop(void);
void SetLeft(float);
void SetTop(float);
private:
float left;
float top;
};
#endif
Tile.cpp
#include "Tile.h"
Tile::Tile(void)
{
*p_iNumTiles++;
}
Tile::~Tile(void)
{
*p_iNumTiles--;
}
float Tile::GetLeft(void)
{
return left;
}
float Tile::GetTop(void)
{
return top;
}
void Tile::SetLeft(float x)
{
float * p_left = &this->left;
*p_left = x;
}
void Tile::SetTop(float y)
{
float * p_top = &this->top;
*p_top = y;
}
Globals.h is pretty much my implementation of stdafx.h . It contains all header files for the project.
Now, for the "dirty" solution - all I have to do is cut the contents of Tile.h into the beginning of LinkedTileList.h and Tile.cpp into the beginning of LinkedTileList.cpp but you can probably tell why this feels dirty. The Tile class is used elsewhere in the project and I don't want to be making it so much a part of the LinkedTileList class, but just a resource that is available to it. Why isn't the preprocessor doing it's job? (And if it is doing it's job and I'm the one who stuffed up, then what am I doing wrong?)
Both the linked list and the tile class are far from finished but I can't go much further until I work out this problem.
|
|
|
|
|
Hi,
my C++ is very rusty but I assume this would solve it:
your LinkedTileList.h needs to know what Tile is, so it should include Tile.h
And you should use a conditional on INC_TILE_H to prevent multiple inclusion.
Hope this helps.
|
|
|
|
|
Globals.h #include 's Tile.h . I also have inclusion guards in ALL my header files.
I've tried including just Tile.h (as the LinkedTileList doesn't actually need anything else from Globals.h but this didn't help either.
Also I forgot to add before that when I cut and paste the contents of Tile.h into LinkedTileList.h and the contents of Tile.cpp into LinkedTileList.h that I get Linker errors. I assume these would be the same errors that exist if I were to find a "cleaner" way of solving these errors. The linker errors are:
1>LinkedTileList.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Node::~Node(void)" (??1Node@@UAE@XZ)
1>LinkedTileList.obj : error LNK2001: unresolved external symbol "public: __thiscall Node::Node(void)" (??0Node@@QAE@XZ)
1>LinkedTileList.obj : error LNK2001: unresolved external symbol "public: __thiscall TailNode::TailNode(void)" (??0TailNode@@QAE@XZ)
Perhaps they can help in diagnosing the issue.
|
|
|
|
|
Hi,
you should not move around code; organize your .cpp files the way you see fit.
Provide .h files that go with them.
have each .cpp file include its own .h file
And make sure all .h files include whatever other .h files are required (so they know the types
and constants they need to know)
Then compile.
If there are errors, the first strategy to try is: work on the first error that shows, until it is
gone. Then iterate, until there are no more errors.
|
|
|
|
|
Those errors mean that you didn't provide a body for the constructor and destructor of the Node class and for the constructor of TailNode. You only specifed a prototype, but no definition of the function. Add a { } after those functions to fix that (this provides an empty function definition).
|
|
|
|
|
Thanks Cedric,
I added a forward declaration for the Tile class in LinkedTileList.h and this solved the compile errors. I then followed your suggestions to fix the linker errors.
Thanks for your help, you're quite the helpful one
|
|
|
|
|
I don't know why but in the release version of my program I get DOUBLE selections (blue line (FULLROWSELECTION is set)); Yet I don't get the error in Debug version. Anyone had simular experience in VS2008 MFC?
A C++ programming language novice, but striving to learn
|
|
|
|
|
Hi,
it could be all kinds of things.
This[^]
might shed some light on your problem.
|
|
|
|
|
The problem is that the list control selects the very first item as well as the item you have selected. It does not do this in debug!, only Release version. Both versions are the same; only you select to compile "release" from the "debug" previous version. The code is the same.
A C++ programming language novice, but striving to learn
|
|
|
|