|
Mohammadj wrote: I,am new can you add the code to http://www.4shared.com/file/105379147/23d04050/dualactionmfcbutton.html[^]
No I can't. Good luck.
"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
|
|
|
|
|
helo
Here is the code i made it did not work loll
Sorry
It compiled but it did not work loll
Here is the code i wrote in
void C_Double_Task::OnClicked()
{
DWORD dwpos = GetMessagePos() ;
CPoint pt ;
pt.x = LOWORD(dwpos );
pt.y = HIWORD(dwpos) ;
CRect client_rectangle ;
GetClientRect( client_rectangle) ;
CString strA , strB ;
double db_a ,db_b ;
GetParent()->GetDlgItemText(IDC_NUM1,strA) ;
GetParent()->GetDlgItemText(IDC_NUM2,strB) ;
db_a = atof(strA);
db_b= atof(strB);
double result ;
result = db_b + db_a ;
CRect leftRect ;
leftRect = client_rectangle ;
leftRect.right = client_rectangle .left +client_rectangle.Width()/2;
if(leftRect.PtInRect(pt))
result = db_b - db_a ;
CString Str_result ;
Str_result.Format("%3.2f",result);
GetParent()->SendMessage(UDM_REGION_CLICKED, result);
}
and
LRESULT CHashiDlg::OnRegionClicked( WPARAM wParam, LPARAM lparan12 )
{
CString resl ;
resl.Format("%3.3",wParam);
SetDlgItemText( IDC_RESULT , resl) ;
return (0);
}
|
|
|
|
|
What doesn't work? Does OnClicked() get called? Does OnRegionClicked() receive the message? Is the value of result correct? What does wParam contain?
[edit]
I just made a few changes to that article I pointed you to and it worked fine.
[/edit]
"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
|
|
|
|
|
Hi
I made this on OnClicked ( the derived custom button)
void C_Double_Task::OnClicked()
{
DWORD dwpos = GetMessagePos() ;
CPoint pt ;
pt.x = LOWORD(dwpos );
pt.y = HIWORD(dwpos) ;
CRect client_rectangle ;
GetClientRect( client_rectangle) ;
CRect leftRect ;
leftRect = client_rectangle ;
leftRect.right = client_rectangle .left +client_rectangle.Width()/2;
IsRight = TRUE ;
if(leftRect.PtInRect(pt))
IsRight = FALSE ;
GetParent()->SendMessage(UDM_REGION_CLICKED, 12);
}
all what do is to set flag if on the right half or left half
LRESULT CHashiDlg::OnRegionClicked( WPARAM wParam, LPARAM lparan12 )
{
UpdateData();
double num1 , num2 , result ;
num1 = atof(m_strNum1);
num2 = atof( m_strNum2);
result = num1 + num2 ;
if (m_two_actions_botn.OnRight() )
result = num1 - num2 ;
m_str_Result.Format("%3.2" ,result);
UpdateData(FALSE);
return (0);
The OnRegionClicked check the flag throught fubction onRight and perform addition or subtraction depending on the value of IsRight ''
it also did not succeed loll
|
|
|
|
|
Did you even bother to read and understand the code in the article I pointed you to 10 days ago? The changes I made to it (to have a two-sided button rather than an eight-sided button) took no more than three minutes.
"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
|
|
|
|
|
Hi there guys!
I wrote a BigNum class with two operations (addition and subtraction) and it consists of an array of integers. But lets suppose I read two numbers, with the following digit separation:
120 43 353 54 345
54 345 455 34 344
This is in base ten. Adding them together I get:
174 388 808 88 689
Which, obviously, is wrong. I used the standard addition algorithm, and it seems correct, so my question is: after "manipulating" the values, how can I print them correctly in base 10? Or do I need to keep a byte string with the digits and start from there?
Best regards
Fratelli
|
|
|
|
|
How you will read big num & fill it in array of int?
AndreFratelli wrote: I used the standard addition algorithm
Please past code over here.
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|
|
Your "digit separation" does not make sense to me.
Looks like you forgot the carry (even though you say you used the standard addition algorithm)
Converting to base 10 is easy, but not trivial (you can not convert every integer to base 10 and then concat them, I hope you didn't even think of that as a possibility)
|
|
|
|
|
AndreFratelli wrote: ...with the following digit separation:
120 43 353 54 345
54 345 455 34 344
Is it normal to have some groups of 2 and others of 3?
"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
|
|
|
|
|
AndreFratelli wrote: 120 43 353 54 345
54 345 455 34 344
You digit separation doesn't make sense. Do your operations make sense, instead?
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]
|
|
|
|
|
Hi
Unable to install platform SDK on Vista Operating System.
Each time a information bar is populated when i click on Default.htm file .
Is there any other way to Install Plateform SDK . I have used many hit and trial methods .
|
|
|
|
|
pandit84 wrote: Each time a information bar is populated when i click on Default.htm file .
Did you choose the "Run as administrator" while running the setup? What error do you get?
|
|
|
|
|
No I have not choose the Run As Administrator .
I am getting the information message as we usually get while allowing the pop ups from some websites. We normally Right Click on this bar and allow the popups by clicking on 'Temparorily allow the pop ups' . Due to this error the installation is not getting done. Previously i have installed platform SDK's but on Windows XP machine. But this times it seems to be a tough job.
|
|
|
|
|
pandit84 wrote: No I have not choose the Run As Administrator .
please try that.
|
|
|
|
|
I use wmi to enumerate all the services running from the system over a network, but in some machines it returns all the services running in them and in some machines it throws error, which i don't understand . Is there any security rights involved or some other type of constraints. Please help
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
You will need the SC_MANAGER_ENUMERATE_SERVICE right for a particular service manager database.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi to all, long time no see.
Recently I had to make some modification to my app. When I was done I've tried to rebuild the project but I've got numerous errors like:
- "d:\program files\microsoft platform sdk for windows server 2003 r2\include\shtypes.h(102) : error C2011: '_SHITEMID' : 'struct' type redefinition",
- "d:\program files\microsoft platform sdk for windows server 2003 r2\include\shtypes.h(120) : error C2011: '_ITEMIDLIST' : 'struct' type redefinition",
and so on ....
Now it may be I've downloaded other platforms or so could this be it or...?
How can I fix this?
Thanks in advanse.
P.S.
VS6, WinXP SP3
|
|
|
|
|
Solved!
Re arranging some directories in Tool->Options->Directories.
Bye
|
|
|
|
|
Hai!
I am using the following sorce code to display JPEG images in my Win CE application developed using eVC++ for a pocket PC device.
http://www.pocketpcdn.com/articles/jpeglib.html
Actually i get a bitmap handle by using the above source code, i display this bitmap handle on my picture control.
Actually i am displaying the image with its original size, but i am not able to see the whole image as the size of screen of my WIN CE device is very small, so i want to display compressed image or display the image after reducing its size?
Is there any function to do it?
Thanks!
|
|
|
|
|
My DLL [^] performs such task. You may use, as well, the GDI+ for the purpose.
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]
|
|
|
|
|
Also StretchBlt[^], which has the advantage of definitely being available of any WInCE build, but the disadvantage of using a lousy resampling algorithm.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have to use skip list to store ~109000 words from a text file.
Here's the code (I'm using Visual C++ 2008):
Struct of the node:
struct SkipNode
{
SkipNode ** forward;
CString mots;
CString longe;
CString pos;
};
Make a new node:
SkipNode* make_node(int level, CString mots, CString pos, CString longe)
{
SkipNode *sn;
sn=new SkipNode;
sn->forward = (SkipNode**)calloc(level + 1, sizeof(SkipNode *));
sn->mots = mots;
sn->pos = pos;
sn->longe = longe;
sn->level=level;
return sn;
}
Insert a node:
void insert(SkipList* ss, CString value, CString pos, CString longe)
{
int i;
SkipNode* x = ss->head;
SkipNode* update[MAX_LEVEL + 1];
memset(update, 0, MAX_LEVEL + 1);
for(i = ss->level; i >= 0; i--)
{
while(x->forward[i] != NULL && x->forward[i]->mots < value)
{
x = x->forward[i];
}
update[i] = x;
}
x = x->forward[0];
if((x!=NULL)&&(x->mots!=value)||(x==NULL))
{
int lvl = random_level();
if (lvl > ss->level)
{
for(i = ss->level + 1; i <= lvl; i++)
{
update[i] = ss->head;
}
ss->level = lvl;
}
x = make_node(lvl, value, pos, longe);
for(i = 0; i <= lvl; i++)
{
x->forward[i] = update[i]->forward[i];
update[i]->forward[i] = x;
}
}
}
My MAX_LEVEL = 17 (log109000).
I read that skip list takes less time to insert a node than some other data structure (O(log n)). So I wonder why I need ~3 minutes to make the skip list above. And when I stop debugging, the program is still running!? I've just started studying programming, please help me!
|
|
|
|
|
Risa Harada wrote: O(log n)
What that defines is how the insertion time grows with n. It does not say that the skip list insertion time is less than the time taken to insert an item into other data structures.
Risa Harada wrote: void insert(SkipList* ss, CString value, CString pos, CString longe)
Risa Harada wrote: SkipNode* make_node(int level, CString mots, CString pos, CString longe)
Pass things like CStrings BY REFERENCE. In this case, by const reference:
void insert(SkipList* ss, const CString & value, const CString & pos, const CString & longe)
SkipNode* make_node(int level, const CString & mots, const CString & pos, const CString & longe)
Other data structures probably have better characteristics for this
- vectors are nice because they've been optimised - it's generally reckoned that if you're going to be reading from and searching in your data structure a lot, you're best off using a vector, sorting it and using std::lower_bound to search.
- std::map or std::set has probably been better optimised
- A trie[^] or alternatively a ternary search tree[^] is generally reckoned to be good for storing words
HTH
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you so much I'll try it out. My professor asked me to use skip list to make a dictionary, so I don't have any other choice.
|
|
|
|
|
Hi,
I am getting a string from the server , and doing following operation to get the BYTE format of that
string key;
This variable contains the value, which I received from server.
BYTE key1[24] = {0};
DWORD dwBase64Size;
CryptStringToBinary(key,0,CRYPT_STRING_BASE64,0,&dwBase64Size,0,0);
if (dwBase64Size>24)
return "";
CryptStringToBinary(key,0,CRYPT_STRING_BASE64,key1,&dwBase64Size,0,0);
This function is working fine for WINXP, but fails on Win2K, as it does not allow the dll to get registered.
In the same way the prolem is with CryptBinaryToString also.
can you suggest a alternate of this code, which works on WIN2K.
Thanks
Vineet Kumar Singhal
Sr.Software Engineer
Mumbai
Tough Time Never last, but Tough People do.
|
|
|
|