|
The Create() member function must show you dialog window, if you didn't see anything, you did something wrong.
A. Riazi
|
|
|
|
|
Well I see that It somehow destroj the dialog window,
Is ther anthing I need to do?
|
|
|
|
|
Hi,,
How do i know at run time, that my application is minimised or lost focus ??
Thanx in advance,
saleem
|
|
|
|
|
Handle WM_SHOW and WM_KILLFOCUS .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
In one of our applications, we are using a lot VBScripts to get some work done like file transfer, etc., since the requirements for these normally varies and hence is not nice to put into our application itself.
Now, the problem we are facing is that when these scripts are executed by our application using the CSCRIPT interpreter, common anti-virus apps like Norton, disable them or pop-up a question to the user. Is there a way to avoid this??
Thanks,
Krishnan
|
|
|
|
|
We wrote the management scripts for our project using python to get around this problem, but I guess that isn't what you wanted to hear,
From a quick experiment it looks like NAV hooks into the actual COM objects that of WSH (only a guess) - I tried getting smart and renaming the interpreters, but it still brings up the error dialogs. This Microsoft Knowledge Base Article seems to indicate that Microsoft don't even have a consistent approach to working around this problem.
http://www.python.org/
Python Windows Extensions
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 your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
how to select few snippets of text at the same time in editbox? then i want to scroll that editbox without losing selection. any ideas?
|
|
|
|
|
I don't believe a standard CEdit supports multi-selection.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi Friends,
In my application, i want to create the Custom UI controls, ie., instead of using windows Default controls like scroll bar, combo box i would like to use my own scroll bar, combo box controls having user defined bitmaps over the controls. Here i have to attached my requirement as a screenshot. Please advice how to create custom UI controls for scrool bar and combo box.
http://img.photobucket.com/albums/v298/pgnanaprakash/Misc/ElementProcessing.jpg
Rgds,
Prakash.
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
Hi,
I was doing one of the beginning VC++ tutorials, and I added a member variable to a class by right clicking on the class name and choosing Add Member Variable from the context menu. However, I typed in the wrong name for the variable, so I wanted to delete it. There didn't seem to be a way to delete a variable using the Class Wizard, so I navigated to the variable in the header file, and I deleted it.
However, when I tried to add the variable with the correct name (once again right clicking on the class name, and choosing Add Member Variable), a pop up box informed me the variable name could not be added. So, I added it by hand to the header file, as well as a few more variables, but when I went to build the project, I got 18 errors relating to the top of the .cpp file for the class.
Is my only option to delete the whole program and start over?
Below I included parts of the code with some comments:
errors:
------------
ompiling...
CodeProject_Dialog2.cpp
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2258: illegal pure syntax, must be '= 0'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(11) : error C2252: 'THIS_FILE' : pure specifier can only be specified for functions
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2838: illegal qualified name in member declaration
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2059: syntax error : 'return'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2238: unexpected token(s) preceding ';'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2143: syntax error : missing ';' before '*'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2501: 'GetMessageMap' : missing storage-class or type specifiers
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2556: 'int *__thiscall CCodeProject_Dialog2App::GetMessageMap(void) const' : overloaded function differs only by return type from 'const struct AFX_MSGMAP *__thiscall CCodePro
ject_Dialog2App::GetMessageMap(void) const'
c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2373: 'GetMessageMap' : redefinition; different type modifiers
c:\beginning c++\codeproject_dialog2\codeproject_dialog2.h(40) : see declaration of 'GetMessageMap'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2143: syntax error : missing ';' before 'tag::id'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2734: 'AFX_MSGMAP' : const object must be initialized if not extern
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : error C2371: 'AFX_MSGMAP' : redefinition; different basic types
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : see declaration of 'AFX_MSGMAP'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2.cpp(17) : fatal error C1004: unexpected end of file found
CodeProject_Dialog2Dlg.cpp
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2Dlg.cpp(11) : error C2258: illegal pure syntax, must be '= 0'
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2Dlg.cpp(11) : error C2252: 'THIS_FILE' : pure specifier can only be specified for functions
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2Dlg.cpp(41) : error C2057: expected constant expression
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2Dlg.cpp(41) : error C2838: illegal qualified name in member declaration
C:\Beginning C++\CodeProject_Dialog2\CodeProject_Dialog2Dlg.cpp(41) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Error executing cl.exe.
CodeProject_Dialog2.exe - 18 error(s), 0 warning(s)
-----------------
header file:
--------------
// CodeProject_Dialog2Dlg.h : header file
//
#if !defined(AFX_CODEPROJECT_DIALOG2DLG_H__0FA170BA_1857_11D9_8F7A_444553540000__INCLUDED_)
#define AFX_CODEPROJECT_DIALOG2DLG_H__0FA170BA_1857_11D9_8F7A_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CCodeProject_Dialog2Dlg dialog
class CCodeProject_Dialog2Dlg : public CDialog
{
// Construction
public:
CCodeProject_Dialog2Dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCodeProject_Dialog2Dlg)
enum { IDD = IDD_CODEPROJECT_DIALOG2_DIALOG };
CListBox m_ProgTech;
CListBox m_YourFavoriteTech;
CString m_strFirstName;
BOOL m_bJava;
CString m_strLastName;
int m_nTitle;
BOOL m_bVisualBasic;
BOOL m_bVisualCpp;
int m_Win98;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCodeProject_Dialog2Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CCodeProject_Dialog2Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
/***THIS IS WHAT I ADDED: *****/
private:
CString m_strFullInfo;
CString m_strOperatingSystem;
CString m_strProgLanguage;
public:
void PopulateProgTech();
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CODEPROJECT_DIALOG2DLG_H__0FA170BA_1857_11D9_8F7A_444553540000__INCLUDED_)
.cpp file where a lot of the errors are:
------------
// CodeProject_Dialog2.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "CodeProject_Dialog2.h"
#include "CodeProject_Dialog2Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
/*THE FIRST ERRORS POINT TO THIS LINE:*/
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCodeProject_Dialog2App
BEGIN_MESSAGE_MAP(CCodeProject_Dialog2App, CWinApp)
//{{AFX_MSG_MAP(CCodeProject_Dialog2App)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
---------------
|
|
|
|
|
|
Hi,
Thanks for taking the time to look over my code. I really appreciate it. Thanks to you, my program now compiles.
|
|
|
|
|
Michael is really a good guy! a man with a lot of knowledge but also be willing to help beginners! This is really a good place here! learn a lot! not only knowledge, also friendship... ^.^ Nice to see you! Have every good day!
You will when you believe!
|
|
|
|
|
Is it possible to send for me TAPI source code.
|
|
|
|
|
|
Hello,
I was wondering, are the STL containers thread safe?
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
They are in a sense that you can safely access distinct containers from differnet threads (actually, even that is not true for the version that ships with VC 6.0). However, you need to take care of locking when accessing a container from different threads.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Thanks for your reply,
I guess that I don't have to remove the Lock() and Unlock() calls in my code .
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
|
Thanks,
I guess that I don't have to remove the Lock() and Unlock() calls in my code .
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hi
I am not able to put the icon size 8x8 on to the button, But the 16x16 and 32x32 are comming with the below code..
HICON hBtnIcon = ::LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON2));
SendMessage(hWndCtrl, BM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM) (HANDLE) hBtnIcon);
::ShowWindow(hWndCtrl, SW_SHOW);
Can I have solution form you?
Regards,
Murali.
|
|
|
|
|
I have a situation were i create dynamic objects and each of them use the
same class(and set of functions in it) to do certain task. To handle the
concurrency issues that may arise while calling same functions at a time -
what are the best solutions?
Is making the function Inline suitable in this scenario in any manner ?
U Live And Let Others Live
|
|
|
|
|
You could use a CCriticalSection to ensure that a method is synchronized. For example:
class CMyClass
{
public:
bool doSomething()
{
if (!m_cs.Lock())
return (false);
...
m_cs.Unlock();
return (true);
}
protected:
CCriticalSection m_cs;
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi!
I'm a fellow that has big problems on starting this next datastructure lab in c++ . I have so much in my mind right now and I don't know if I'm gonna complete this lab on time.
So i'm wondering if there are someone that could help me with this lab?
We use at the school visual studio 6.0
Here's the lab description:
A) Hash table
Now your going to make an article-storage were the articles will be saved in a hash-table for fast prompt accessible. For every article saves the information of the article-number, article-type and the amount articles in the storage.
You should be able to “hash” on the article-number( i.e article-number is the key). You should be able to ADD, SEEK and LIST the articles in the storage.
The programme shall handle collision with "Separate Chaining” i.e create linked list at collisions. You shall therefore make an array of pointers that initiate to NULL, afterward you should be able to seek and add articles that are missing.
At collision you do your linked list. Use here as said a linked list and a string class.
Remember when you add an article for the first time to the index, you have to move the NULL-pointer to point at the new post and then link the article last in the list.
If an article with that article-number already exist in the list, the numbers on the storage should increase on the one that already existed.
Does’nt the articlename correspond, then you could yourself decide how it’s gonna be solved in your programme.
Assume from these files(must use)
1. Hash.h
2. Hash.cpp
3. Article.h
B) Sorting
This task goes out on that you have to implement 3 optional sorting-algorithms. The algorithms shall be choosed so an algorithm works with O(n2), next with O(n log n) and the last one with O(n).
Write a programme that at random takes number-values to a file. This file shall be used as indata for sorting. After the sorting, shall the result be written out into a result-file. The result-file shall also be used as indata for sorting, to see how the algorithms works on the already sorted or almost sorted data ( if some values changes).
You shall have to create data-files with 5 different quantity of numbers to sort. These values shall be used as indata to respective algorithm. Run the algorithm with indata that is both sorted and unsorted.
You shall use these following numbers: 100 000, 200 000, 400 000, 800 000 and 1 600 000 values. Same computer must be used to check all values to have a more fair result and the computer may not work with other things during the process of the sorting.
Is it so that your computer makes the sorting too quick or too slow, you may have to change some numbers so you get a better result, NOTE that the quantity of the numbers shall double for each sorting.
Every algorithm shall have two variables, compare and swap, that counts how many comparision and copies of values has been made during the sort. These two variables shall be used in comparision between the different algorithms.
Registrate also the time the algorithms take when they are used, by using following class:
1. Timer.h
2. Timer.cpp
Do a table with your results that contains these facts:
• Run with an unsorted and a sorted data
• Values for compare and swap for respective run
• Time-consumption for respective run
Here comes the code for the following files.
1. Hash.h
<br />
#ifndef _HASH_H<br />
#define _HASH_H<br />
<br />
#include "LinkedList.h"<br />
<br />
class Hash<br />
{<br />
public:<br />
Hash();<br />
~Hash();<br />
<br />
private: <br />
const int TABLESIZE;<br />
LinkedList *m_table;<br />
};<br />
<br />
#endif<br />
2. Hash.cpp
<br />
#include "Hash.h"<br />
<br />
Hash::Hash() : TABLESIZE(11)<br />
{<br />
m_table = new LinkedList[TABLESIZE];<br />
}<br />
<br />
Hash::~Hash()<br />
{<br />
delete[] m_table;<br />
}<br />
3. Article.h
<br />
#ifndef _ARTICLE_H<br />
#define _ARTICLE_H<br />
<br />
#include "String.h"<br />
<br />
class Article<br />
{<br />
public: <br />
Article(int i_key, int i_number, String i_type);<br />
<br />
private:<br />
int m_key;<br />
int m_number;<br />
String m_type;
}; <br />
<br />
#endif<br />
4. Timer.h
<br />
#ifndef TIMER_H<br />
#define TIMER_H<br />
<br />
class Timer<br />
{<br />
public:<br />
Timer(){ m_startTime = 0; m_stopTime = 0; }<br />
int startTimer();
double stopTimer();
<br />
double getTime();
private:<br />
<br />
double m_startTime;<br />
double m_stopTime;<br />
double m_frequence;<br />
};<br />
<br />
#endif<br />
5. Timer.cpp
<br />
<br />
#include <windows.h><br />
#include "timer.h"<br />
<br />
<br />
int Timer::startTimer()<br />
{<br />
LARGE_INTEGER start, freq;<br />
if(!QueryPerformanceFrequency(&freq))<br />
return 0;<br />
m_frequence = (double) freq.QuadPart;<br />
QueryPerformanceCounter(&start);<br />
m_startTime = (double)start.QuadPart;<br />
return 1;<br />
}<br />
<br />
double Timer::stopTimer()<br />
{<br />
LARGE_INTEGER end;<br />
QueryPerformanceCounter(&end);<br />
<br />
m_stopTime = (double)end.QuadPart;<br />
<br />
return (m_stopTime-m_startTime) * 1000.0 / m_frequence;<br />
}<br />
<br />
double Timer::getTime()<br />
{<br />
return (m_stopTime-m_startTime) * 1000.0 / m_frequence;<br />
}<br />
That's all. You can send me the programme by mail if you finished the lab. That would be awesome!
THANK U ALL!
|
|
|
|
|
El_Maco wrote:
You can send me the programme by mail if you finished the lab.
I don't think you're going to get any takers here. If you have a specific problem or question, we'd be happy to help you.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|