|
Hi guys,
just a quick question with printing in VB.Net. I have managed to print a form by making an image and using the BitBlt API, though I have been unsuccessful in getting the entire form if it scrolls past the size of a form.
Could someone please point me in the right direction?
Thanks in advance,
Daniel
-- modified at 1:48 Tuesday 13th March, 2007
Found a control that does what I want, though it needs a little tweaking for my purposes. I hope this also helps others looking for a similar solution:
http://www.codeproject.com/csharp/ControlPrint.asp[^]
|
|
|
|
|
Hi,
I'm creating a DLL and there is a code listing below that gets and puts an array of characters named minput. When I send English characters to the put function, there is no problem. I can get back the correct characters with get function. But when I send non-English characters (like Turkish characters ı,ç,ö,ş,ğ,ü), the function returns some strange characters.
Is there any idea why this is happening?
Thanks
PS: The project's character set is set to "Use Unicode Character Set" as default.
//Input.h
...
public:
char minput[100];
public:
STDMETHOD(get_m_input)(BSTR* pVal);
public:
STDMETHOD(put_m_input)(BSTR newVal);
...
//Input.cpp
...
STDMETHODIMP CInput::get_m_input(BSTR* pVal)
{
// TODO: Add your implementation code here
CComBSTR bstStr(this->minput);
*pVal=bstStr.Detach();
return S_OK;
}
STDMETHODIMP CInput::put_m_input(BSTR newVal)
{
// TODO: Add your implementation code here
::wcstombs(this->minput,newVal,99);
return S_OK;
}
...
|
|
|
|
|
xelontr wrote: char minput[100];
Modify this to, TCHAR minput[100]; . And make you application UNICODE enabled.
|
|
|
|
|
I changed type of the array to TCHAR and changed the put function's wcstombs to
_stprintf(minput, _T("%s"), (LPCTSTR) newVal);
and it worked. Is there any other (easy) way to change the BSTR to TCHAR? Or is this the best one?
Thanks again
|
|
|
|
|
xelontr wrote: Is there any other (easy) way to change the BSTR to TCHAR?
Consider using ConvertBSTRToString .
And does using TCHAR solved your problem ?
|
|
|
|
|
Yes, TCHAR solved the problem. Now the functions work properly.
But I can't use ConvertBSTRToString. It gives "cannot convert from 'char *' to 'TCHAR [100]'" error.
Thanks
|
|
|
|
|
xelontr wrote: ConvertBSTRToString. It gives "cannot convert from 'char *' to 'TCHAR [100]'" error.
ConvertBSTRToString returns char* , where as TCHAR is defined as wchar_t in case for UNICODE and char otherwise.
So use appropriate conversion function.
|
|
|
|
|
Hi all,
Can anyone explain to me why when IE7 is shut down my control's destructor is not called?
Thanks
Tom
I'm using: VS.NET 2003, XP SP1, ATL, IE7
Philosophy: The art of never getting beyond the concept of life.
|
|
|
|
|
What type of control it is ? I mean is it BHO ?
I remmember similar porblem(not in IE), when in client I forgot to release control.
|
|
|
|
|
Hi Prasad, thanks for the response.
My control is a windowless ActiveX control embedded in a web page.
Tom
Philosophy: The art of never getting beyond the concept of life.
|
|
|
|
|
Haven't used control anytime that way.
But, just a guess, if you needed to access control interface, then have you released it ?
|
|
|
|
|
I'll have to look into that. There might be something wrong at the core. It's an old control, not originally created by me.
Philosophy: The art of never getting beyond the concept of life.
|
|
|
|
|
Yes, it seems , control is never released.
|
|
|
|
|
Thanks I'll post if I find any thing useful.
Tom
Philosophy: The art of never getting beyond the concept of life.
|
|
|
|
|
We are creating a instance of Internet Explorer with CoCreateInstance,of type CLSCTX_LOCAL_SERVER.
Though the IE instance is successfully created ,it picks up the process id of an existing prior opened IE instance.
Is this behaviour inherent to IE?
Is ther any way to create a IE instance with its own specific process id.
|
|
|
|
|
my question is simply :
ATL with wxWidgets ,is it possible????
when i tried to use the problem is
"wxmsw28d_core.lib(paper.obj) : error LNK2001: unresolved external symbol __imp__calloc"
"wxProject.dll - 1994 error(s), 0 warning(s)"
|
|
|
|
|
Ok. I think I want to create two web services in the same ATL server dll. But I want them to be able to work on the same session. Using ISessionStateService, ISession and attributed ATL ISAPI.
I got "session state keeping" to work for the same web service. But how to make the second one to be able to find the session and retrieve variable stored by the first?
Help!
Thanks a lot!
Maksim.
"personal world record"
|
|
|
|
|
Anyone know why the .push_back function for a vector would overwrite the last entry. So for example, if i push 10 items into the vector. When i am done, the vector size shows 10 but the only item in there is the last one. I am totally clueless on this.
I call this function in a dll:
DLL_API int GetDATA(std::vector<datainforecname*>& pVectorDataInfoRecName, std::string sPath )
Then i process a DataInfoRecName pointer.
_tcscpy( pDataInfoRecName->szDate, TempString.c_str ());
Then i push it into the vector
pVectorDataInfoRecName.push_back(pDataInfoRecName);
|
|
|
|
|
Hello All!
I am newbie in ATL/COM programming, so I have tried to firing events based on this article
http://www.codeproject.com/atl/SimpleATLCom.asp for VC 2005 final.
I put the following code to the .h file
<br />
[<br />
dispinterface,<br />
nonextensible,<br />
hidden,<br />
uuid("DEEA616A-2B80-4965-9A31-2F67B704EB70"),<br />
helpstring("_ISimpleObjEvents Interface")<br />
]<br />
__interface _ISimpleObjEvents<br />
{<br />
[id(1), helpstring("method TotalMarks")] HRESULT TotalMarks([in] SHORT TotalMark);<br />
};<br />
...<br />
<br />
<br />
[<br />
...<br />
event_source(com),<br />
...<br />
]<br />
class ATL_NO_VTABLE CSimpleObj :<br />
public ISimpleObj<br />
{<br />
...<br />
__event __interface _ISimpleObjEvents;<br />
...<br />
}<br />
And trying to rise event
like this:
<br />
__raise TotalMarks(TotalMark);<br />
In my basic client I am trying to catch event like this:
<br />
Private Sub Obj_TotalMarks(ByVal TotalMarks As Integer)<br />
'Display the MessageBox displaying Total Marks<br />
MsgBox("total marks " & TotalMarks)<br />
End Sub<br />
Help me please, where I am wrong?
|
|
|
|
|
|
Thanks a lot, the problem was resolved by adding the "Handles Obj.TotalMarks" at the end of Obj_TotalMarks subroutine definition:
Private Sub Obj_TotalMarks(ByVal TotalMarks As Integer) Handles Obj.TotalMarks
|
|
|
|
|
I want to send and receive object to an ATL COM object. For example I create following classes
Input (IInput)
Output (IOutput)
RunP (IRunP)
Input has an (BSTR) attribute named "m_input" and Output has an (BSTR) attribute named "m_output". Also RunP has a method named "process" it gets an IInput object and returns IOutput object.
I assign a string to m_input from C# code. Then I print the m_input with MessageBox. But the program stops running and gives following errors
"Run-Time Check Failure #3 - The variable 't' is being used without being defined"
AccessViolationException
It gives the error in get_m_input line.
STDMETHODIMP CRunP::process(IInput* inp, IOutput** outp)
{
BSTR* t;
inp->get_m_input(t);
MessageBox(NULL, *t, L"asd", 0);
return S_OK;
}
I can't find the problem. Is there any documentation that explains how to send and receive objects from a ATL COM object.
Thanks
|
|
|
|
|
xelontr wrote: BSTR* t;
inp->get_m_input(t);
Probably, this function is expecting variable with memory allocated, modify this code to this and try,
BSTR t;
inp->get_m_input(&t);
|
|
|
|
|
I want to store a group of employee objects in an array or collection of some type and then be able to find which employees are of a certain department number. For example there may be a total of 10 employees with 4 of the employees belonging to department 1 and the rest to various other departments, I want to be able to find all of the employees belonging to department 1 and print those out. What do you think is the best way to do this? I tried to use a vector sequence container, but I don't know how I would find multiple employee objects depending on dept number attribute.
Any help would be greatly appreciated,
Jason
|
|
|
|
|
You could have a map containing vectors. The map key would be the department number, and the data would be a vector (or better, a pointer to a vector) of employees.
Steve S
Developer for hire
|
|
|
|