|
After displaying buffer value am getting a Blank Screen
|
|
|
|
|
Sorry, but this really does not explain your problem. From some of your other questions and answers I suggest you may need to study this item on Resources.
|
|
|
|
|
Literals are NOT stored in the string table, if I guessed what are you asking...
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]
|
|
|
|
|
I have printed "Hi" in my application.
If I want to retrieve "Hi" from an EXE.
What should I do?
|
|
|
|
|
Put your strings into a stringtable.
|
|
|
|
|
That's what how to put it into string table and then how to display it from EXE?
|
|
|
|
|
Create a resource file (.rc) and add your string(s) to the stringtable. Then you can simply load the strings with LoadString() or CString::LoadString() if you are using MFC.
|
|
|
|
|
Isn't there a string table which is automatically made?
How to retrieve from that string table?
|
|
|
|
|
Are you the same person as the thread starter? Or do you just have the exact same problem?
Anyway, it very much depends on how you created your application. If you used a Visual Studio wizard then you will possibly already have a resource script included in your project, depending on which app type you chose.
If not - and you are using Visual Studio - it's very simple to add resources to your project. Look at the documentation.
|
|
|
|
|
Hi
How to established connection in mysql without ODBC?
Plz help me
|
|
|
|
|
Hi all,
i want to use Menu on right click of ListCtrl,
i m using this code
void CTest::OnNMRClickList(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pia = (LPNMITEMACTIVATE)pNMHDR;
UINT flags;
DWORD pos = GetMessagePos();
CPoint point(LOWORD(pos), HIWORD(pos));
m_List.ScreenToClient(&point);
int nItem = m_List.HitTest(point, &flags);
HMENU hMenu = ::CreatePopupMenu();
if (NULL != hMenu)
{
::AppendMenu(hMenu, MF_STRING, 1, "Test1");
::AppendMenu(hMenu, MF_SEPARATOR,2, "");
::AppendMenu(hMenu, MF_STRING, 3, "Test2");
::AppendMenu(hMenu, MF_SEPARATOR,4, "");
::AppendMenu(hMenu, MF_STRING, 5, "Test3");
ClientToScreen(&point);
int sel = ::TrackPopupMenuEx(hMenu,TPM_LEFTALIGN|TPM_RETURNCMD,point.x,point.y,m_hWnd,NULL);
switch(sel)
{
case 1:
{
}
break;
case 3:
{
}
break;
case 5:
{
}
break;
}
}
*pResult = 0;
}
its working fine only one problem is here its not popup the menu on tip of mouse cursor.
please tell me where i m wrong.
please help me .
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: DWORD pos = GetMessagePos();
CPoint point(LOWORD(pos), HIWORD(pos));
m_List.ScreenToClient(&point);
I think perhaps this is where your problem lies. The list box returns the cursor position in the LPNMITEMACTIVATE structure. You will need to convert this position to its absolute screenvalues via
ClientToScreen(hWnd, &pia->ptAction);
and then use pia->ptAction.x and pia->ptAction.y in your call to TrackPopupMenuEx().
|
|
|
|
|
No its not working
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What is not working? What have you tried, and what results do you see?
|
|
|
|
|
Now i m using like this
UINT flags;
DWORD pos = GetMessagePos();
CPoint point(LOWORD(pos), HIWORD(pos));
m_List.ScreenToClient(&point);
int nItem = m_List.HitTest(point, &flags);
HMENU hMenu = ::CreatePopupMenu();
if (NULL != hMenu)
{
::AppendMenu(hMenu, MF_STRING, 1, "Test1");
::AppendMenu(hMenu, MF_SEPARATOR,2, "");
::AppendMenu(hMenu, MF_STRING, 3, "Test2");
::AppendMenu(hMenu, MF_SEPARATOR,4, "");
::AppendMenu(hMenu, MF_STRING, 5, "Test3");
ClientToScreen(&pia->ptAction);
int sel = ::TrackPopupMenuEx(hMenu,TPM_LEFTALIGN|TPM_RETURNCMD,pia->ptAction.x,pia->ptAction.y,m_hWnd,NULL);
switch(sel)
{
case 1:
{
}
break;
case 3:
{
}
break;
case 5:
{
}
break;
}
}
but still when i right click on ListCtrl the menu not popup from tip of mouse cursor.
please help me.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
This looks correct now, so I am at a loss to understand why it does not poup at the correct location. Where does it appear on your system relative to the screen? You may also like to use the debugger to check the values of x and y before and after the ClientToScreen(&pia->ptAction); call.
|
|
|
|
|
Thanks its done now.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
How I will write a macro to check that weather the pointer is NULL or not and if NOT then delete it.
Ex;
CXyz * abcd = new CXyz();
// do some thing with *abcd
if (abcd != Null)
{
delete abcd;
abcd = NULL:
}
I have to write a macro so as not to write the code again
Or shall I write a function for the same but then what will be its prototype
Please tell me how and where to write the code for it.
|
|
|
|
|
That's even more simple than that: you don't even need to check if the pointer is NULL or not, the delete operator takes care of that. So, if you pass a NULL pointer to delete, nothing happens.
EDIT: BTW, no need to repost your question so quickly, this is a forum here, not a chat...
|
|
|
|
|
Does delete operator checks for NULL itself?
Well I have to assign NULL after deleting also.
How I will define it
#define DELETE(ptr)
Is this declareation of macro is correct?
If yes then whhere I Will write its functionality
|
|
|
|
|
Honnestly, I would advise you not to write a macro for this. In general, using macro (in this particular case) makes the code harder to read. Here, it doesn't really have any additional value (except that you don't have to type the assignment).
Anyway, if you really want to do something like that, the macro would be:
#define DELETE(ptr) delete ptr; ptr = NULL;
|
|
|
|
|
Thanks a lot.
But why should not write a macro in this case,well I have read on Net also that we should not write a Macro for deleting.But I did'nt come accros any good reason.Will you please provide me one.
|
|
|
|
|
Because macros can have unforeseen consequences - consider this:
#define DELETE(ptr) delete ptr; ptr = NULL;
if (myPtr->DeleteMe()) DELETE(myPtr);
That's translated by the pre-processor to
if (myPtr->DeleteMe()) delete myPtr; myPtr = NULL;;
So myPtr will be set to NULL even if it shouldn't be deleted...
There are ways around that, but I'd rather write this:
template<class _Ty>
inline void Delete(_Ty*& ptr)
{
delete ptr;
ptr = 0;
}
because it's not messing around with the program text - it doesn't rely on pre-processor magic.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
like this?
#define MyDelete(_ptr) if (_ptr) {delete _ptr; _ptr=NULL;}
|
|
|
|
|
hi guys i and bard...i want to do a braille programming using visual C++..
firstly...the key that input was S,D,F,J,K,L...how can i set the input from keyboard...
example like> if i push the input from keyboard letter SDF is for image 1, S for image 2,SDFJKL for image 3 or etc...
example>the sentences was
'saya suka makan'
s=image 1
a=image 2
y=image 3
a=image 1
s=image1
u=image 4
k=image 5
a=image 2
m=image7
a=image 2
k=image 5
a=image 2
n=image 8
display look like,
image 1,image2,image3,image1 ,image 0,image1,image 4,image5,image6,image0,image7,image2,image5,image2,image8
*image 0 for the space.
i wanted to put just 20 image on row...every time finish, i can reset the image...
please guys help me! email me..hightemperature@yahoo.com
|
|
|
|
|