|
As per our application we cannot change the range. So the Y-Values should be changed.
|
|
|
|
|
Why don't you just divide the Y-values by 2 ( 60 / 30 = 2)
then you get {2.5, 10, 20, 30} which all fit in the specified range
codito ergo sum
|
|
|
|
|
Hi All,
I am implementing Drag and Drop of files from "my Namespace extension" to windows folders. Can anyone tell me what I need to do to allow for Drop into explorer left pane?? Both From Desktop folder to My namespace extension and vice versa. Is there any special clipboard format that I need to implement for this to happen?
Thanks and Regards,
Anil
|
|
|
|
|
Hi all
Still working with my 64-bit researching and conversions, now I've found myself stucked on an error where the _CONTEXT struct in Winnt.h is involved. The following two fields are only long in that struct, but as you probably know a pointer in x64 is 64-bit and not 32... So, I'm afraid of that the previos cast from Context.Eip and Context.Ebp to a pointer would not work so very well...
Eip
Ebp
So, how to workaround this problem? I've tried to find a simple fix but in that research I find myself more and more convinced that it isn't so easy. I'm pretty convinced now that there is some other way to handle the information in that struct in x64, but how?
I'm programming in VS2005 but the code is supposed to be platform independant.
TIA
|
|
|
|
|
If you have the appropriate headers, you should find the correct definition for _CONTEXT on x64. In my copy of the Platform SDK supplied with Visual Studio 2005, this starts on line 2368 of WinNT.h.
You won't find Eip or Ebp members here. These registers are extended on x64 to 64-bits and go by new names, Rip and Rbp.
To ensure you get the correct _CONTEXT structure, you need to ensure you're defining _AMD64_ rather than _X86_ .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks, found it and it's probably working now...
|
|
|
|
|
Hey friend,when I add new record to sql via m_pConn->execute("Insert..",,),it's ok.
but m_pConn could not control the cursor like m_pRecord,Problem comes,
while
m_pRecord->AddNew();
m_pRecord->PutCollect(L"Column",_variant_t("value"));
complier pass,but when progam start to run,it abort with message "Abnormal program termination",what's indicating with my code?
please give me a hand as quick.
Lee
|
|
|
|
|
I don't know, but here's a guess:
m_pRecord->PutCollect(L"Column",_variant_t(L"value"));
Steve
|
|
|
|
|
Thanks you,but it looks no function.
another suggestion?
expecting Online
Lee
|
|
|
|
|
Hi
I would like to ask you what is the best way to input a binary number. For example I want to read from a file 1011 and input it as an int variable as ELEVEN (1011 in binary) and not as a THOUSAND AND ELEVEN. Should we input it as a string and then write a little function that would return the integer equivalent or is there a more efficient way (faster) to do this?
thx.
|
|
|
|
|
read the file in binary mode, otherwise, you'll have to parser the string to recreate your own binary parsing (as C/C++ cannot handle binary directly).
be aware also that you cannot assign an integer (whatever type - char, short, long, int, __int64) with less of 8 bits...
|
|
|
|
|
v2.0 wrote: read the file in binary mode
From what I understood, the binary number is written litteraly (so you will have something like 00100101 in the file, not binary data).
|
|
|
|
|
Yes, the best way (IMO) is to read the number in a string and make a conversion function that returns an integer.
The conversion should be quite easy: start from the end of the string and add 1<<Pos to the result if there is a 1 at the position Pos (Pos is 0 at the end of the string)
|
|
|
|
|
// Console.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <bitset>
using namespace std;
int main(int argc, char* argv[])
{
// Types
enum
{
BitsPerByte = 8
};
typedef unsigned long NumType;
typedef bitset<sizeof(NumType)*BitsPerByte> BitsetType;
BitsetType bt;
cout << "Enter a binary number: ";
cin >> bt;
cout << "Number in decimal is: " << bt.to_ulong() << endl;
return 0;
}
Steve
|
|
|
|
|
There is already sush a function.
char szBuffer[80];
sprintf_s(szBuffer, 80, "1011");
int iBinValue = strtoul(szBuffer,
NULL,
2);
codito ergo sum
|
|
|
|
|
Yes, that's true ! I always forget about this one . Why reinventing the wheel ?
|
|
|
|
|
The only reason for reinventing the wheel is ...
when yours is rounder
codito ergo sum
|
|
|
|
|
Yes but in general is rarely the case because this code has been tested by a lot of people before you.
Another reason is that you want to learn how the wheel turns
|
|
|
|
|
Possibly it's no rounder but lighter...
Steve
|
|
|
|
|
Hi
I am creating a dialog based application. I have made a globle thread function (I know it is not a good idea but...). I have a dialog box in which i have an edit box. Now from within that thread, i want to change value of that edit box. Can anyone please help me how can i do that? I tried to get handle to that dialog but i could not...
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Hi
If u r using MFC, the AfxBeginthread function have a parameter to send a parameter to thread from calling function.
U can send the dialog's pointer to thread and by the dialog's pointer u can change the edit box value.
syntex:
AfxBeginThread(threadname, stacksize, void_parameter);
For exam,
void CMyDlg::OnBtnClick()
{
AfxBeginThread(MyThread, 0, this);
}
UINT MyThread(void *param)
{
CMyDlg *dlg= (CMyDlg )param;
.........
dlg->m_MyEdit.SetWindowText(text);
.........
return 0;
}
U can refer the sterday's message
http://www.codeproject.com/script/comments/forums.asp?msg=1452858&forumid=1647#xx1452858xx
|
|
|
|
|
Hi Parthiban
you are right but as i think, your code will work fine if CMyDlg is the main dialog of my application. But in my case, the dialog is not main dialog. It added that dialog from resoures. This dialog is a pop up dialog. In my case, that dialog is not initiating the thread. Thread is being initiated by main dialog.
Sorry i forgot to mention it before. Please help me.
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Hi
Wat ever be the Dialog. if u can able to get the pointer of the dialog then u can change any values in the dialog.
Aqueel wrote: Thread is being initiated by main dialog.
Can u explain when u r initiating thread from main dialog? is any event from pop-up dialog?
|
|
|
|
|
In fact it is a timer. In main dialog, when user presses a button, a small dialog appears that counts time remaining and displays this time in an edit box.
I used your method. But how will i use UpdateData(false) here because to display changed value i will have to call this function.
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
GetDlgItem(IDC_THE_EDIT)->SetWindowText("new caption");
|
|
|
|