|
With what part, specifically?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi,
i have maintained all my Reminder info in records..say m_pSet->ReminderDate....etc...
problem for me i cant get a logic...
I am using onTimer() function in which i want a logic so that i may search for created records(say for nrecords) everytime and whenever i found the Exact match with syatem date and time,i must popup put a msg...can u help me
|
|
|
|
|
Hello Friends,
Please tell me which file is modified if I modify the project settings by pressing Alt+F7
Thanks in advance.
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote:
Please tell me which file is modified if I modify the project settings by pressing Alt+F7
Project.DSP
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Hello Friends,
I don't to display the Horizontal scroll bar in the ListView of my application. I am displaying some images and whenever I resize the window sometimes Horizontal scroll bar is displayed, So I tried using ShowScrollBar(SB_HORZ,FALSE) member function then the View is flickering whenever the scrollbar is being disabled. I got known the reason for the flickering as I am using CustomDraw() member function also.
Please help me in making the horizontal scroll bar to disappear without removing the customdraw member function.
thanks in advance.
Neelesh K J Jain.
|
|
|
|
|
I want to be able to call a function from a derived class in a base class function using pointer to this function. Example using reinterpret_cast follows, but it does not compile using mingw So maybe someone can explain me what I can do in this situation? Maybe I can use function objects, if yes, then how and what would serve the best? Thanks in advance!
#include <iostream>
// forward declaration
struct func_struct;
class data {};// base data class
class mydata : public data // new data class
{
public:
int i; // one class member
};
class base // main functionality
{
public:
virtual func_struct* get_func()=0;
void dothings(data* pData);
};
typedef void (base::*func)(data *);
struct func_struct
{
func pfunc;
};
void base::dothings(data* pData)
{
func_struct* fs=get_func();
// how to get the pointer???
(this->*fs.pfunc)(pData);
};
// specific functions
class child : public base
{
public:
virtual func_struct* get_func()
{
static func_struct maping;
// how to store pointer???
maping.pfunc=reinterpret_cast<func>(my_func);
return &maping;
}
void my_func(mydata* p)
{
p->i=1;
}
};
int main(int argc, char *argv[])
{
mydata d;
std::cout<<d.i<<std::endl; // should be 0
child c;
c.dothings(&d);
std::cout<<d.i<<std::endl; // should be 1
return 0;
}
Regards,
Alexander.
|
|
|
|
|
I want to disable selection in a listbox, with the scrollbar enabled.
Calling EnableWindow(false) disables the scrollbar too.
How can I solve this?
Thank you
|
|
|
|
|
What about creating a listbox derived class which would simulate the disable state through a simple boolean attriute? This class would draw the items as if they were disabled, manage the mouse and keyboard inputs accordingly, but let the base class manage the scroll bar.
Fold With Us!
"For every complex problem there is an answer that is clear, simple, and wrong" - H.L. Mencken
|
|
|
|
|
Am using the following code to addthe flow in the interface.
HANDLE flwHndl;
HANDLE ClFlowCtx=0;
TC_GEN_FLOW flg;
flg.SendingFlowspec.TokenRate = 64;
flg.SendingFlowspec.TokenBucketSize = 64;
flg.SendingFlowspec.PeakBandwidth = 10000;
flg.SendingFlowspec.Latency = 10;
flg.SendingFlowspec.DelayVariation = 10;
flg.SendingFlowspec.ServiceType = 1;
flg.SendingFlowspec.MaxSduSize = 1440;
flg.SendingFlowspec.MinimumPolicedSize = 64;
flg.ReceivingFlowspec.TokenRate = 64;
flg.ReceivingFlowspec.TokenBucketSize = 64;
flg.ReceivingFlowspec.PeakBandwidth = 10000;
flg.ReceivingFlowspec.Latency = 10;
flg.ReceivingFlowspec.DelayVariation = 10;
flg.ReceivingFlowspec.ServiceType = 1;
flg.ReceivingFlowspec.MaxSduSize = 1440;
flg.ReceivingFlowspec.MinimumPolicedSize = 64;
flg.TcObjectsLength = 0;
errcode = 0;
errcode = TcAddFlow(hndl ,ClFlowCtx ,0,&flg,&flwHndl);
What could be wrong in the parameters?Am getting ERROR_INVALID_PARAMETER as the 'errcode'.Thnx in advance.
redindian
|
|
|
|
|
In short How a program can determine that from where it is ordered to execute
"by a shortcut or another exe with their identity" so that we can decide to execute or not, or execute accordingly?
What I mean is that I want to run an application through a particular shortcut say on the desktop. if the anybody double clicks at the exe file in the directory it wont run. If some one makes his own shortcut to the same exe file then it wont run. i.e. it only run by the shortcut which i have made during installation.
Any idea/api.
Please Help...
|
|
|
|
|
the only thing i can think of is to include a parameter in the shortcut that the target .exe looks for, and if it's not there, don't execute it. But doing it this way would still allow a user to copy that shortcut and make their own. The only other thing I can think of is making a simple little exe with that parameter to be sent to the target .exe used in a call to ShellExecute().
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Thanks
Second one is a good idea.
|
|
|
|
|
Hi,
I am writting a program using vc++.
My question is-
I have two dialog boxes D1 and D2.Dialog Box D1 contains one command button (Click) and dialog Box D2 contains One text box I would like to do, suppose we press Click button on dialog box D1 then D2 dialog box should be called and text box should be disable.
I would not like to write this code on OnInitDialog()of D2,because I know this codes work well. BOOL CD2:OnInitDialog() {
CDialog::OnInitDialog();
Cedit pEdit;
pEdit=(CEdit*)GetDlgItem(IDC_EDIT1);
pEdit->EnableWindow(false);
return TRUE;
}
Now, I wrote code
void CD1::OnOk()
{
// TODO: Add your control notification handler code here
CD2 d2;
// I would like to write code here for disable text box(IDC_EDIT1) on dialog box D2
d2.DoModal();
}
Please help me.
Any help appreciated.
Regards
rajesh
|
|
|
|
|
You can not do it the second way, you have to use the first. The edit control does not exist until the DoModal call is made so there is no window to disable.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Why don't you just add a member to CD2?
CD2 d2;
d2.EndableEdit(FALSE); // default is TRUE
d2.DoModal();
Simple!
Of course you could also write constructor for CD2 that take an argument to disable/enable the control.
INTP
"I am a firm believer in the KISS principle!"
|
|
|
|
|
do you think it will work unless the dialog created
|
|
|
|
|
I have a function that accepts an UINT nChar. I need to pass nChar along to another function in the form of char* string. How would I make this conversion?
Thank you
|
|
|
|
|
This code will help
<font color=green>
char ch[2];
sprintf(ch,"%d",nChar);
<font color=green>
FunctionNeedCharString(ch);
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
char s[2];
sprintf(s,"%c",nChar); // NOTE: %c NOT %d
Func(s);
OR
s[0] = (char)(unsigned char)nChar; // insurring proper conversion
s[1] = '\0';
Func(s)
Note: If you ever plan to allow code to work with Double Byte Characters or UNICODE, then neither of the above methods should be used (w/o modifying).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Dear friends:
i have an audio file that use vivo's siren codec.
all of the data is pure audio data. but i don't know if i can add a wave header and then play it using Windows Media player.
can anyone help me?
if it can be played using Windows Media player, then can give me a sample wav file?
if it can't be played using Windows Media player, then how can i play this file?
|
|
|
|
|
Hi,
Data could be shared between processes through ways like file mapping, mailslot, pipe, DDE and so on. But if data contain pointers like the following structure, how can processes share this kind of data?
struct Pointers{<br />
FirstStruct* pFirstStruct;<br />
SecondStruct* pSecondStruct;<br />
}
Appreciating answers from anybody. Thanks.
|
|
|
|
|
What about using shared memory, through a memory-mapped file?
Fold With Us!
"For every complex problem there is an answer that is clear, simple, and wrong" - H.L. Mencken
|
|
|
|
|
One way this will work is to create a memory mapped file at the same virtual address in both processes. The pointers in your data structures must point to this 'shared' memory that is at exactly the same address.
One thing to keep in mind, virtual memory available in one process at a speciftic address might not necessarily be available in the second, like one has a DLL loaded there already or something.
I would strongly recommend against the use of the pointers like this.
You could change your data structure to store an index, and have an array of your FirstStruct and
SecondStruct in shared memory, then they would not have to be at same address.
struct DataIndexes{
DWORD dwFirstStructOffset;
DWORD dwSecondStructOffset;
}
array of FirstStruct in shared memory
array of SecondStruct in shared memory
These two don't need to be in same shared memory mapped file, either.
Then you do not have to worry if the data is shared at exactly the same virtual address.
If you know how many items you need ahead of time, the easiest way woudl be to just create array of
struct SharedData{
FirstStruct mFirst;
SecondStruct mSecond;
}
and make an array of them in the shared memory (via memory mapped file), which, again, would not have to be at same virtual address within each process.
|
|
|
|
|
Consider the following scenario
In a MDI application
A and B are two objects of Class V(CView) . There is one Document object D .
Consider data represented as T (say a buffer of 1024 bytes) . This data can be stored as a file (F) or in another device (R).
A is a graphical representation of F and B is a graphical representation of R .
F and R are managed by a Server (S)
In the app , D(the one and only one) talks to S .
I have some basic questions :
1) D , based on the API calls to S knows if the data it is receiving is meant for either A or B . Does D have knowledge of A and B . In other other words can he do
A->Populate() and B->Populate()
This would mean that the Doc class pushes data to its view . I wasnt too sure of this
2) If the above is not allowed , It meants that based on a call that D makes ( like UpdateAllViews)
A and B have to update their representation .
Consider that fact that my file has changed by 1 bit , do i have to reload/refresh the entire buffer ? If i want to avoid this I have to add a significant amount of information in D
I am not able to zero in on the right methodology . I hope some one can give me a direction
thanks
Engineering is the effort !
|
|
|
|