|
If you have the handle of the window you want to paste to, you could try sending it a WM_PASTE message.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
can you give me an example to how use WM_PASTE ??
thanks alot
|
|
|
|
|
MSDN is usually the first place I go to for such things. Google is another.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
OK thanks alot for your help... and sure there are alot of questions in my mind, and i am going to need help soon...hehe
thanks alot.
|
|
|
|
|
I am currently trying to develop a print provider. So, as the first step, I tried to compile and install the example which comes with DDK. So I successfully compiled "pp" and copied the relative DLL into system32/.
Then It comes the time to register into the spooler system the new provider, so I used the following piece of software, which calls AddPrintProvider ().
#include <windows.h>
#include <string.h>
#include <stdio.h>
int main (int argc, char* argv []) {
int result;
PROVIDOR_INFO_2 pi2;
pi2.pOrder = "C:\\WINDOWS\\system32\\pp.dl";
if (argc != 2) {
printf ("Command not recognized. Use ''install'' or ''uninstall''\n");
return 0;
}
if (strcmp (argv [1], "install") == 0) {
printf ("install... ");
result = AddPrintProvidor (NULL, 2, (LPBYTE) &pi2);
} else
if (strcmp (argv [1], "uninstall") == 0) {
printf ("uninstall... ");
result= DeletePrintProvidor (NULL, NULL, pi2.pOrder);
} else
printf ("Command not recognized. Use ''install'' or ''uninstall''\n");
if (result != 0)
printf ("ok\n");
else {
DWORD err = GetLastError ();
printf ("error: %d\n", err);
}
}
Well, I don't need to say that the output of the program is to signal an error. More precisely it signals error code #2 (file not found).
I tried various combinations of values for pi2.pOrder but I still can't understand what's going on and why it always gives me this error. The file pp.dll is into c:\windows\system32
The DDK documentation just says that I have to copy the needed files there and then call AddPrintProvider.
Does anyone know how to register a print provider ???
What am I doing wrong ??
|
|
|
|
|
Hi all,
I wanna how to send data to com.
I have CportController class.I get web.
I use following function.
long CPortController::Write(LPCTSTR WriteBuffer, long NumBytesToWrite, long Timeout)
{
long result;
static BYTE parms[] =
VTS_BSTR VTS_I4 VTS_I4;
InvokeHelper(0x18, DISPATCH_METHOD, VT_I4, (void*)&result, parms,
WriteBuffer, NumBytesToWrite, Timeout);
return result;
}
This function is work.But PLC screen is not display.
Thank.
|
|
|
|
|
Hello guys,
I am trying to play with a List control (report style) and I would like to do the following thing :
I select a row in my list (that becomes highlighted) and, thanks to 2 buttons (UP and Down), I exchange the place of this raw with the previous one (UP) to make it go to the top of the list or with the next one (DOWN) to make it go to the bottom of the list.
After a click on one of my buttons, I exchange the 2 rows, my row is no more highlighted and I would like it to keep highlighted. I have tried to play with the SetItemState to set the focus and the selection bits to make it highlighted again but without success.
So my question is : how do I give my row this selected aspect (highlight) by program?
Thanks in advance
DD
|
|
|
|
|
m_List.SetItemState(index,LVIS_SELECTED, LVIS_SELECTED);
this will do
|
|
|
|
|
hello,
that's exactly what I tried (except if my memory fails), LVIS_SELECTED as value and as mask ... I also tried LVIS_FOCUSED ... but without success.
I will doublecheck tonite.
This should immediatly highlight the item, no need of redraw or something else ?
Thanks for the answer
DD
|
|
|
|
|
Have you tried LVS_SHOWSELALWAYS Style? It always show the selection, even if the control does not have the focus.
Use SetExtendedStyle() to set the LVS_SHOWSELALWAYS.
P.
|
|
|
|
|
good idea !!
it is true that the list lost control because I clicked the button ...
Thanks for answer
DD
|
|
|
|
|
Strange .. it doesn't work.
In fact, if I add the LVS_SHOWSELALWAYS option, the control works as if there was a hot item, the fact to keep the mouse pointer over an item selects it, but as soon as I click my buttons, the highlight desappears ...
Very strange ...
Could it be a kind of icompatibility with another option?
I also use : LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES, LVS_EX_INFOTIP, LVS_REPORT
I really don't understand what happens ..
Thanks in advance for help
DD
|
|
|
|
|
hi,
I ve got some C++ classes that I d like to share with some guys. I d like to make a help file, with a hierarchy chart, the class members, a search engine and so on.. Actually, exactly like MSDN with the MFC. However, I m not familiar at all with this. So here is the question:
Could anybody give me tips about how to make this kind of things (language, soft,and so on)?
cheers
|
|
|
|
|
|
Check out doxygen[^]. There's a online manual[^] for it too.
This will also create a HTML Help project that you can run though the HTML Help compiler and generate a Windows HTML Help .chm file.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hi,
Use HTML Help Workshop for VC++. Hope this will help u. Gives the same look and feel as that of MSDN.
Vikram Kashyap
"You will never fail, until u stop trying"
|
|
|
|
|
If you are referring to the little app that comes with the HTML Help compiler and friends, and that organizes things into a crude sort of project, then you're quite mistaken. The only thing that makes it like MSDN is the fact that it outputs the help into a single .CHM file. Doc book outputs a .hhp and .hhk files for use in the HTML Help compiler or even the workshop if you want.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
I have make a project a,which linked a dll b,how can I make profile that can display the fuctions in b. thanks
|
|
|
|
|
Hi,
I am learning VC++ with some experience with C++, I could compile and execute some simple programs like finding a prime etc successfully. Now I am trying to learn creating a new window using MFC. Whenever I execute the code, i get the following message"
"Hello.exe has encounetered a problem and needs to close..please tell Microsoft about the problem...."
The appname and modname in the technical data are both Hello.exe.
When I click on the Debug button in this window it gives me the following message
"The instruction at "Ox0045c8fb" referenced memorry at "0x00000000". The memory could not be "read". Clik ok to terminate the program."
In the Debug information I have:
Loaded 'C:\WINDOWS\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\SHLWAPI.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found.
The thread 0x9F0 has exited with code 0 (0x0).
The thread 0x9C4 has exited with code -1073741819 (0xC0000005).
The code I am trying to execute is:
// Creating a Hello.cpp win 32 application.
#include <afxwin.h>
class C_MyApp:public CWinApp
{
BOOL InitInstance();
};
class C_MainFrame:public CFrameWnd
{
public: C_MainFrame();
};
C_MainFrame::C_MainFrame()
{
Create(NULL,"Main Window");
}
BOOL C_MyApp::InitInstance()
{
m_pMainWnd=new C_MainFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
return TRUE;
}
void main()
{
//int m_pCmdShow;
C_MyApp myApp;
}
Can anyone help me on how to successfully execute this program?
Thanks in Advance,
Regards,
Frank Michael,
"Faith is a great stimulant so is Fear"
|
|
|
|
|
Try crate simple SDI project using AppWizard and see deference with you code
You forget many ...
|
|
|
|
|
In the following source code fragment a metafile is generated with a line with a length of 60 millimeter using GDI+. The problem is when I analyse this metafile with Visio or print 1:1 on paper, the dimension of the line is not 60 mm ! I hope somebody can tell me the reason.
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Metafile* myMetafile = new Metafile(L"MyDiskFile.emf", ::GetDC(NULL));
Graphics* myGraphics = new Graphics(myMetafile);
Pen* myPen = new Pen(Color(255, 0, 0, 200));
myGraphics->SetPageUnit(UnitMillimeter);
myGraphics->DrawLine(myPen, 0, 0, 60, 0);
delete myGraphics;
delete myPen;
delete myMetafile;
GdiplusShutdown(gdiplusToken);
|
|
|
|
|
I have my code to open the file-dialog box. With this I am able to select the file, but I want to open the file in an notepad. Can anybody help me for this?
Here goes my code. Thanks in advance
try
{
CWaitCursor wait;
CString filename = _T("");
CFileDialog dlg(true, "txt", "*.*", 0, _T("Log Files (*.txt)||"));
CString logs_path = getenv(_T("ENV_VARIABLE"));
logs_path += _T("\\Logs");
dlg.m_ofn.lpstrInitialDir = logs_path.GetBuffer(logs_path.GetLength());
// now let the user select
int result = 0;
result = dlg.DoModal();
if (result == IDOK)
{
// get the new file name
filename = dlg.GetPathName();
// does the file exist??
CFileStatus status;
if (!CFile::GetStatus (filename, status))
{
// do nothing
}
}
else
return;
}
catch (...)
{
//...
}
- Prashant
|
|
|
|
|
Try ShellExecute using the full path to the file selected.
This will open the file using the default application for .txt files, probably notepad.
"Nothing is impossible for the man who doesn't have to do it himself." - A. H. Weiler
|
|
|
|
|
ShellExecute(hWnd,"open",
"notepad.exe", filename,NULL, SW_SHOW );
There is no spoon.
mail
|
|
|
|
|
Hi,
If I create an activeX component using the visual c++ that comes with vs.net 2003 - Is it possible for a client to download this component and use it without having to download the whole .net framework??
|
|
|
|
|