|
ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
but in the case of
CDialogTemplate dlt;
LPCTSTR ID=_T("IDD_TESTDLG_DIALOG");
if (!dlt.Load(ID)) return -1;
i need to pass id as String instead of integer...the doubt it is not working is i send id as
string...
Sorry for inconvenience caused ....
|
|
|
|
|
p_1960 wrote: ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
It returns a LPTSTR .
p_1960 wrote: i need to pass id as String instead of integer...the doubt it is not working is i send id as
string...
Did you look at the preprocessor's output?
"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
|
|
|
|
|
ya it"s not recognising the ID which sent as string but it is working fine if i pass ID AS
integer..
Pls let me know...
|
|
|
|
|
p_1960 wrote: ya...
So what is its output?
p_1960 wrote: ...it"s not recognising the ID which sent as string but it is working fine if i pass ID AS
integer..
Pls let me know...
You may want to re-read this thread to understand exactly what it is that I am asking of you.
"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
|
|
|
|
|
Dialog name IDs should be either a string or a 16-bit unsigned integer.
If you remove dialog id definition (#define IDD_TESTDLG_DIALOG number) from the file named "resource.h", it will work. Or you should enter that name with double quotes (like "IDD_TESTDLG_DIALOG") as dialog ID of dialog properties.
|
|
|
|
|
Howdy, slow day today, waiting for a phone call.
I was looking at some code recently, and there was an include like this :
#include "myfile.h"
And I was wondering from what "library" this file comes from. I know I could do a right-click and open and look at the property... but from a code point of view it's not very practical (IMO).
So, I looked in the project's settings to see that there are about 25 lines of "additional include paths", one for each library we have:
for example :
../lib/lib1
../lib/lib2
../lib/lib3
../lib/lib4
So, the questions :
Is it best practice to limit the number of "additional include path" to a minimum and have more descriptive include directive in the code ?
for example :
in the project settings :
../lib
and in the code have this :
#include "lib1/myfile.h"
#include "lib2/myfile2.h"
Is there a compilation performance issue with having a large amount of include paths vs. having more descriptive
includes in the code ?
Any good reading about this topic available somewhere ?
Thanks.
This signature was proudly tested on animals.
|
|
|
|
|
Maximilien wrote: in the project settings :
../lib
and in the code have this :
#include "lib1/myfile.h"
#include "lib2/myfile2.h"
That's what I'd likely go for
Best practise? Is there one? I don't think so. But in the *nix world, they tend to use that pattern. For example, in my Mac's /usr/include directory, there are 267(!) directories for different libraries (like libxml, libxslt, rpc, subversion, python).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I would like to get all text values from my MS Access database, I can access directly each column value (ie: str[0] = FF_Text.m_Column1, str[1] = FF_Text.m_Column2, ...)
But instead do like that for 27 times ... I would like to access them through their columns! However, I could not find the way to retrieve column text value!
CString str[27];
strSQL.Format ("SELECT * FROM TABLE_Text WHERE Title = 'Information'");
FF_Text.Open (AFX_DAO_USE_DEFAULT_TYPE, strSQL, 0);
if (!FF_Text.IsEOF())
{
for (i=0; i<27; i++)
{
str[i] = FF_Text.(???)
}
}
FF_Text.Close();
Can any one help?
|
|
|
|
|
ATC2000 wrote: str[i] = FF_Text.(???) // Get text value in intended column
Are you looking for the GetFieldValue() method?
"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
|
|
|
|
|
I did try before but forgot to examine the error (not well define). Now it is OK, I got all column text!
Thanks for help
|
|
|
|
|
Hi all,
I am trying to use the IGPM interface from the gpmgmt.dll. The dll is registered in Win2008 server. But when I execute my exe file (written in C++) it simply throws an HRESULT error - "0x80040154 The class is not regsiteresd" and the GetLastError returns "1008 ERROR_NO_TOKEN".
Any help is appriciated.
Thanks.
Subha
|
|
|
|
|
Hi,
I created a tab control using Win32 , I require to add X button and h-scroll(Right top corner) as in VS2005 IDE. can any one give a idea how to Override tab control, X button like IE7 will also be good.
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
std::list < xlong > ClientConfig:: GetHistory(int id)
{
....
doing something
....
return 0;
}
When the above code is compailed in VS 2005 (VC++), following is the error
error C2664: 'stlp_std::list<_Tp>::list(const stlp_std::list<_Tp> &)' : cannot convert parameter 1 from 'int' to 'const stlp_std::list<_Tp> &'
with
[
_Tp=xlong
]
Reason: cannot convert from 'int' to 'const stlp_std::list<_Tp>'
with
[
_Tp=xlong
]
Constructor for class 'stlp_std::list<_Tp>' is declared 'explicit'
with
[
_Tp=xlong
]
resdata.cpp
I tried to return xlong value, but still getting the same error
Can any once help to fix the same
|
|
|
|
|
Look at what the function is supposed to return (a std::list<xlong>) and look at what you are actually returning (an integer). IF you want this to work, you either have to change the return type to long or return a std::list<xlong> object form your function.
|
|
|
|
|
Can I open different dialogs in an application and have them remain open?
I am trying to avoid using MDI.
Or do I have to open different instances of my application and use IPC to communicate between them?
Can someone help please?
Thanks.
|
|
|
|
|
What are you trying to achieve exactly ? Do you want multiple dialogs on which the user can interract at the same time ? If yes, then your dialogs have to be modeless dialogs.
But this has nothing to do with MDI, so I don't see why you are talking about that . Maybe I didn't understand your question correctly.
|
|
|
|
|
Thank you. Yes Modeless is what I was looking for.
I am sorry If I confused you.
|
|
|
|
|
A tabbed dialog interface should suffice your needs.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hey good people,
I am in need of an idea for a problem that has to have been solved a throusand times over. But after implementing some code that should take care of the troublemaker (rand()) - but didn´t - and a lot of research I am at a loss here.
I built a server which has to generate some random numbers for each client that connects. So I created a nice singleton wrapper class for the random generator and now it´s seeded (srand(time(NULL))) once at startup and thereafter every call should present me an actual (pseudo-)random number.
As you may have guessed, theory didn´t work out. All numbers are very random for every single call from ONE client. As soon as another client connects it gets THE SAME 'random' sequence of numbers. Even though the seed was plantet only once AND they don´t even ask at the same time.
Here´s a little code on the number generation, maybe someone has an idea:
ToolBox* ToolBox::m_pToolbox = NULL;
ToolBox::ToolBox(void)
{
m_pLogger = Logger::GetInstance();
srand ( time(NULL) );
}
ToolBox::~ToolBox(void)
{
}
ToolBox* ToolBox::GetInstance()
{
if( m_pToolbox == NULL )
{
m_pToolbox = new ToolBox();
}
return m_pToolbox;
}
BYTE ToolBox::GenerateRandomByte()
{
BYTE ret = LOBYTE((WORD)rand());
int r1 = rand();
int r2 = rand();
int r3 = rand();
int r4 = rand();
m_pLogger->Out( Logger::DEBUG, "TestRand 1: %d\nTestRand 2: %d\nTestRand 3: %d\nTestRand 4: %d\n", r1, r2, r3, r4 );
return ret;
}
int ToolBox::GenerateRandomInt()
{
return rand();
}
Any help is appreciated. Thanks.
Souldrift
|
|
|
|
|
|
I´ll look into it, thanks .
|
|
|
|
|
You should move the srand call:
ToolBox::ToolBox(void)
{
m_pLogger = Logger::GetInstance();
srand ( time(NULL) );
}
and
ToolBox* ToolBox::GetInstance()
{
if( m_pToolbox == NULL )
{
m_pToolbox = new ToolBox();
srand ( time(NULL) );
}
return m_pToolbox;
}
[added]
Nevermind I made a blunder.
[/added]
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]
modified on Wednesday, June 24, 2009 8:49 AM
|
|
|
|
|
umm, where´s the difference. It gets called once either way.
Cheers
|
|
|
|
|
Yes, you're right. I made a blunder, forget it.
Could you please show us how a client uses the ToolBox ?
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]
|
|
|
|
|
Of course. Only the client doesn´t use the ToolBox. The server does. For each client it has to create an RTP Header for an RTP data transfer. Which is done in my class RTPHeader.
RTPHeader::RTPHeader( int payloadType )
{
m_pLogger = Logger::GetInstance();
m_pToolbox = ToolBox::GetInstance();
m_pLogger->Out(Logger::DEBUG, "RTPHeader: Constructing Header.\n");
for( int i = 0; i < 12; i++ )
{
m_aHeader[i] = 0;
}
SetPayloadType( payloadType );
SetVersion( (BYTE) 2 );
GenerateNewSsrc();
m_bFirstGetInc = true;
PrintToConsole();
}
RTPHeader::~RTPHeader(void)
{
}
void RTPHeader::GenerateNewSsrc()
{
m_aHeader[9] = m_pToolbox->GenerateRandomByte();
m_aHeader[10] = m_pToolbox->GenerateRandomByte();
m_aHeader[11] = m_pToolbox->GenerateRandomByte();
}
.
.
.
In GenerateNewSsrc() the ToolBox´s Random Generator is used. It works nicely for this small piece of code. Only that for the next client that connects to the server it will generate the same sequence all over.
And my test output in the ToolBox class actually shows that it is indeed the rand() method that produces the same results. It´s not a variable that wasn´t cleared or such something. A new RTPHeader class object is created for every client.
Cheers
|
|
|
|