|
switch only works with integral types.
|
|
|
|
|
|
How to set bitmap image as Background of RichEdit on WIN32 API?
I can`t fiend any real working methods.
|
|
|
|
|
I found this guide, and I tried to use Method #2 :
http://support.microsoft.com/default.aspx?kbid=194873[^]
However, as you can guess, building the VC++ project failed:
Error 1 fatal error C1083: Cannot open type library file: 'd:\data\visual studio 2005\projects\smbus64\smbus64\bin\x64\release\smbus64.dll': Error loading type library/DLL. d:\data\Visual Studio 2005\Projects\SMBus64\VC_DLLtest\VC_DLLtest.cpp 5
Line 5 of my Cpp is:
#import "D:\data\Visual Studio 2005\Projects\SMBus64\SMBus64\bin\x64\Release\SMBus64.dll" no_namespace
Does anyone know of a similar guide that works with Visual Studio 2005 ?
|
|
|
|
|
The linked article has nothing to do with a VB.NET DLL .
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
|
|
|
|
|
indeed, hence I am looking for a guide like it that works with VS2005
spent 4 hours searching the interwebs... and counting...
|
|
|
|
|
|
Hi All,
I'm currently working on determining the location of variables. I can find globals and constants in .data and .rdata.
I'm looking for a better way to determine if a variable is located on the stack. Currently I am using inline assembly to pull it out of the ETHREAD structure (intel/nt specific). I'd like to find an API to determine the Top/Bottom of the stack. Does anything come to mind? I did not see it in VirtualQuery[Ex]().
Thanks,
Jeff
void main()
{
int i;
....
}
PBYTE pStackTop = NULL;
PBYTE pStackBottom = NULL;
__asm
{
push eax
mov eax,fs:[18h]
mov eax,dword ptr [eax+4h]
mov pStackTop, eax
pop eax
}
pStackBottom = pStackTop - pNTHeader->OptionalHeader.SizeOfStackReserve;
if( pStackBottom < pAddress && pAddress <= pStackTop )
{
return "stack";
}
|
|
|
|
|
Im feeling generous again today! So I modified your function. I am using an undocumented technique here! Its a hack!
BOOL InsideStackHack(LPVOID p)
{
PVOID pStackTop = NULL;
PVOID pStackBottom = NULL;
__asm
{
push eax
push ebx
mov ebx,fs:[18h]
mov eax,dword ptr [ebx+4h]
mov pStackTop, eax
mov eax,dword ptr [ebx+0xe0c]
mov pStackBottom, eax
pop eax
pop ebx
}
return (pStackBottom < p && p <= pStackTop);
}
Perhaps you would rather use my second creation, this one is not quite as hacktastic.
BOOL InsideStackNoHack(LPVOID p)
{
PNT_TIB lTeb = (PNT_TIB)NtCurrentTeb();
PVOID pStackTop = lTeb->StackBase;
MEMORY_BASIC_INFORMATION MemoryBasicInformation;
VirtualQueryEx(GetCurrentProcess(),p,&MemoryBasicInformation, sizeof MemoryBasicInformation);
PVOID pStackBottom = MemoryBasicInformation.AllocationBase;
return (pStackBottom < p && p <= pStackTop);
}
Good Luck,
-David Delaune
|
|
|
|
|
Hi David,
I stumbled across NtCurrentTeb() in WinNT.h after the post. According to the header, I know it works for _M_IX86 and _M_AMD64. Do you know about _M_X64 and _M_IA64?
Jeff
|
|
|
|
|
Hi,
I would like to display a variable list of users in a simple text control. How can I display multiple text lines with "..." at the end of the last line (if the client area is too small for the whole text)?
I tried a CStatic with m_users.ModifyStyle(0, SS_ENDELLIPSIS) , but unfortunately this sets the control to show a single line.
Thanks
/Moak
modified on Friday, March 14, 2008 9:54 AM
|
|
|
|
|
won't it be annoying the user seeing the ellipsis at each line? won't it be looking clean if you add scroll bars?
|
|
|
|
|
Maybe I wasn't clear... the output should look like this:
-------------------
|user1 user2 user3|
|user4 user5 user6|
|user7 |
-------------------
and if the text becomes longer than what would fit into the client area:
-------------------
|user1 user2 user3|
|user4 user5 user6|
|user7 user8... |
-------------------
|
|
|
|
|
Is using either WS_VSCROLL or ES_AUTOVSCROLL not possible?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Could be an alternative... right now I wonder if this would be possible at all, if such a control exists?
Some background: My user list is already inside a resizeable dialog, basically it fills up an empty space. When I designed this dialog I thought it would look nice and clean to have no scrollbars and instead let ellipsis indicate that there are more users to display. If the user is interested to see more he can resize the dialog.
|
|
|
|
|
Moak wrote: If the user is interested to see more he can resize the dialog.
You can still do this, just let the scroll bar(s) indicate more users. When the dialog is resized and the edit control grows, the scroll bar(s) will disappear.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have not tried this to prove it works but I would try painting it myself using GDI+ DrawString, StringFormat and StringTrimming[^] just to see if it works.
led mike
|
|
|
|
|
|
hi to all
Why HRESULT function is not accept in windows vista in these function in this function can run only Windows XP/NT .suppose when i change that function Windows vista what i can do ..?
in this function contains winerror.h
*****THANKS N ADVANCE****
Mathen.K
(I WILL TRY MY LEVEL BEST )
|
|
|
|
|
rowdy_vc++ wrote: what i can do ..?
Post an understandable question.
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
|
|
|
|
|
rowdy_vc++ wrote: (I WILL TRY MY LEVEL BEST )
Is that your level best to describe your problem? You really really need a career change. Please consider it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
When I don't have classes I do this to export my entry points:
//########################
//C++
extern "C" __declspec(dllexport) int __stdcall SumUp_unmgdCPP(int a, int b, int* c)
{
c[0]=4; c[1]=3; c[2]=2; c[3]=1;
//########################
//C#
[DllImport("NameOfDLL", CallingConvention = CallingConvention.StdCall)]
public static extern int SumUp_unmgdCPP(int a, int b, int[] f);
public int SumUp(int a, int b, ref int[] f)
{
return SumUp_unmgdCPP(a, b, f);
How do you do it in a C++ dll-project with classes? I did this:
class FMS
{
public:
extern "C" __declspec(dllexport) int __stdcall SumUp_unmgdCPP(int a, int b, int* c);
private:
float m_WheelSpeed; // 1
}
It complains about the string "C" above being part of the declaration above. I don't think this is the way you do it when you have classes. Just paste the equivalent of what I'm doing in at the top in a dll-project with no classes but now instead in a C++ dll-project with classes and I will be very thankful.
/Lars
|
|
|
|
|
See here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I could not get the link file path using IContext. I hope if I could read the property of that file I can get it.
Because In this articalhttp://www.codeproject.com/KB/shell/shellextguide5.aspx[^]">The Complete Idiot's Guide to Writing Shell Extensions - Part V, you set the link file path in a static control. I just want to get using InvokeCommand() or using any technique but with right click on my menu item not property item of file.
|
|
|
|
|
Hi, Im a MFC bigginer and neeed help to understand the crash which is caused by my program. I have created a Dialog i MFC and in the method OnInitDialog, I create a class which it creates a function in a thread and there is a loop in the method which sends the values to dialog via a interface. When I try to update the dialog by UpdateData(FALSE)the application crashes.
Please help me out of this problem
Thanks in advance.
M.H
BOOL CThreadDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
Thread1 *pThread = new Thread1(this);
return TRUE; // return TRUE unless you set the focus to a control
}
void CThreadDlg::setValueAlt1(int inValue1, int invalue2)
{
m_Value1.Format("%.3d", inValue1);
UpdateData(FALSE);
}
DWORD WINAPI ThreadFunc( LPVOID lpParam )
{
ISetValue * pISetValue = (ISetValue *)lpParam;
int a=44;
int b = 45;
for (int i=40; i<100; i++)
{
pISetValue->setValueAlt1(i, b );
Sleep(10);
}
return 0;
}
Thread1::Thread1(ISetValue *pISetValue)
{
DWORD dwThreadId;
HANDLE hThread;
LPVOID param = pISetValue;
m_pISetValue = pISetValue;
//pISetValue->setValueAlt1(44, 99);
//return;
hThread = CreateThread(
NULL, // no security attributes
0, // use default stack size
ThreadFunc, // thread function
param, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
}
|
|
|
|