|
You created a function for login ok then...
whitesky
|
|
|
|
|
i have cereated the function for login...but i dont know how to write code for that???
I am using Active X controls in my project.And the Api has all the function for that which i have in my project as awrapper class.This Active X control is going to b bridge b/w client and server....
I am stuck in the point of coding..
I am new to programmimg.....Thanks
|
|
|
|
|
|
LOGIN TO ODL SERVER TO GET SESSION ID AND DATA FROM THAT
|
|
|
|
|
Given the path of the file, how to open it with code? just like you double click it.
Thank you very much!!!
|
|
|
|
|
Use ShellExecute with the "open" verb.
e.g.
ShellExecute(
NULL,
_T("open"),
_T("C:\\a.txt"),
NULL,
NULL,
SW_SHOWDEFAULT
);
You will need to #include <shellapi.h> and link to "shell32.lib".
Steve
|
|
|
|
|
thank you very much for your help.
|
|
|
|
|
|
Hi guys,
I was wondering, when I do a system-wide WriteProcessMemory Hook it manages to crash Explorer on windows XP. The Hook works the way it supposed to but when the hook is initiated it crashes explorer. Would anyone know the reason why it does that?
I'm using the SetWindowsHookEx to do the hook. It works on all my other export functions, but for some reason explorer crashes when I initiate this particular hook.
Any help is appreciated. Thanks,
Robbie
|
|
|
|
|
What do you mean a "WriteProcessMemory Hook"? I know about SetWindowsHookEx but you don't explain how WriteProcessMemory fits into the picture. If you use DLL injection using SetWindowsHookEx the hook DLL is in-process and so can access the prosess's memory directly without the need for WriteProcessMemory .
Steve
|
|
|
|
|
Solution:
Silly me. Originally I had intended to do this stuff in header files, which meant I had to use __declspec(selectany) with these declarations. But at one point, I moved them into the .cpp files, but forgot to remove the __declspec . That directive tells the compiler to keep one reference to the code for the entire link module. If no other code references it, the code is discarded. All I had to do was to remove the directive, and voila!
I have a rather awkward problem with the optimizer in the VS2k3 C++ compiler.
I'm using global objects to initialize a linked list, which I later pick up in the program.
It works sort of like this:
struct Entry {
Data data;
Entry* next;
};
extern Entry* g_head = 0;
...
struct OneOfMyGlobalObjects {
OneOfMyGlobalObjects() {
static Entry entry;
entry.data = ...;
entry.next = g_head;
g_head = &entry;
}
} g_OneOfMyGlobalObjects; As the g_OneOfMyGlobalObjects variable is never used anywhere in the application, the compiler optimizes it away. Obviously, I don't want that. I figured I could circumvent this by slapping an extern onto the variable, but that didn't help. I went as far as putting a __declspec(dllexport) on it - that did the trick. Although, I don't want to export these objects. It's not the end of the world if I do, but I like tidiness.
Also, I do not fancy the idea of turning off some global optimizer switch, as I like optimization (but just not in these specific instances).
So, is there any magical #pragma or __declspec available?
--
Based on a True StoryLast modified: den 19 juli 2006 18:21:40 --
|
|
|
|
|
Hi all,
I'm trying to invoke web services written in c# from a VC++ 7.1 app.
The function I'm invoking is quite simple.
<code>
[WebMethod]
public int Foo(int i)
{
return i + 1;
}
</code>
It works fine when I test the client in C#. I then tested in VC++. I added the web reference and SPROXY generate the header files for me. Here's is my client code in c++
<code>
...
if (SUCCEEDED(CoInitialize(NULL))))
{
TestServices::CTestServices ws;
int ret = 0;
HRESULT hr = ws.Foo(3, &ret);
CoUninitialize();
}
</code>
However ws.Foo() returns E_FAIL. I stepped in the generated code and it failed at BeginParse() function in atlsoap.h
<code>
virtual HRESULT BeginParse(IStream *pStream)
{
ATLASSERT( pStream != NULL );
CComVariant varStream;
varStream = static_cast<IUnknown*>(pStream);
HRESULT hr = m_spReader->parse(varStream); //it fails here
if (SUCCEEDED(hr))
{
if (m_refMap.GetCount() != 0)
{
hr = E_FAIL;
}
}
return hr;
}
</code>
And I see following error message in the output window
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: Action.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: MessageID.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: To.
ATLSOAP: CSoapRootHandler::GetElementEntry -- element not found: Security.
ATLSOAP: CSoapRootHandler::endElement -- invalid SOAP message format while processing headers.
Also, here is the xml result returned by the web service call
<?xml version="1.0" encoding="utf-8"?>
<int xmlns="http://www.blahblah.com/webservices/">4</int>
What am I missing? Thank you all in advance.
-- modified at 17:41 Wednesday 19th July, 2006
|
|
|
|
|
I'm getting the same error. Please let me know if you got the answer for this problem.
Thanks,
Kapil
|
|
|
|
|
I kind of hate imagelists.
I'm trying to draw transparent images (without masks) from a CImageList with the ILD_TRANSPARENT ILD_NORMAL parameter and obviously it does not work as intended, because the error is between the chair and the keyboard.
This is how I do it :
My bitmap ( IDR_MAINFRAME ) is a 256 colours bitmap with RGB( 192, 192, 192 ) as the background
colour; the dialog BG colour is RGB( 218, 222, 232 )
void CAboutDlg::OnPaint()
{
CPaintDC dc(this);
COLORREF cDialogBG = RGB( 218, 222, 232 );
CRect rect;
GetClientRect( rect );
CBrush brush;
brush.CreateSolidBrush( cDialogBG );
dc.FillRect( rect, &brush );
CBitmap bmp;
bmp.LoadBitmap(IDR_MAINFRAME );
CImageList imageList;
imageList.Create(16,15, ILC_COLOR8, 4, 1);
imageList.SetBkColor( CLR_NONE );
imageList.Add(&bmp, RGB( 192, 192, 192 ));
imageList.Draw( &dc, 0, CPoint( 10, 10 ), ILD_NORMAL );
}
I'm becoming clueless and a bit aggravated because it seems i'm doing all the basics rights, and this should work as advertised.
Thanks.
( modified because I screwed up my post )
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
-- modified at 20:39 Wednesday 19th July, 2006
|
|
|
|
|
You don't say what the problem is. I guess the image is drawing OK but not tranparent?
You say you are using ILD_TRANSPARENT but that is not in the code you posted
You say the image background color (transparent color) is 256,256,256 but that is not in the code you posted
|
|
|
|
|
yeah, that's how I feel, I can't even post a question properly today.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
You need to use the ILC_MASK flag when creating the image list for it to have a mask (which is how it does transparency). Then when you add the images, use icons (which have built-in trasparency) or a bitmap with one color that indicates the transparent parts.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Is it possible to check if the microphone is in use?
|
|
|
|
|
This sound familiar!
First, how are you opening the microphone device?
Assuming that you are using waveInOpen(...) it will return MMSYSERR_ALLOCATED if someone else already has a handle to the microphone.
If waveInOpen is not the way you are using the Mic then let us know in what context you are using it so that we can give an intelegent answer.
AliR.
Visual C++ MVP
-- modified at 16:59 Wednesday 19th July, 2006
|
|
|
|
|
Hi fellows.
I have a treeview(populated) and I would like to select a single node I have this code:
<br />
case WM_NOTIFY:<br />
{<br />
TV_ITEM tempTvItem;<br />
char cTemp[256]="";<br />
unsigned int uiVal = 0;<br />
LPNMHDR notifyMessageStruct = (LPNMHDR)lParam;<br />
if(notifyMessageStruct->hwndFrom == treeViewHwnd)<br />
{<br />
if(notifyMessageStruct->code == NM_CLICK)<br />
{<br />
nodeSelected = (HTREEITEM)SendDlgItemMessage(treeViewHwnd, IDC_TREE1, TVM_SELECTITEM, TVGN_CARET, (LPARAM)nodeSelected);<br />
tempTvItem.mask = TVIF_TEXT|TVIF_HANDLE;<br />
tempTvItem.hItem = nodeSelected;<br />
tempTvItem.pszText = cTemp;<br />
tempTvItem.cchTextMax = 256;<br />
SendMessage(treeViewHwnd, TVM_GETITEM, 0, (LPARAM)&tempTvItem);<br />
MessageBox(NULL, tempTvItem.pszText, "", MB_OK);<br />
...<br />
My problem is that the select part. The node isn`t selected and in the MessageBox nothing is shown.
What`s the problem? I want when I select the node it remais highlighted and selected.
|
|
|
|
|
Where did you get IDC_TREE1 from??
If you are using a CTreeView view, why aren't you using GetTreeCtrl()->SelectItem(...);?
AliR.
Visual C++ MVP
|
|
|
|
|
I`m not using CTreeView, I`m creating the treeview with CreateWindowEx function. and in the HMENU part
I include the IDC_TREE1 like the ID of the window.....
Like this:
<br />
treeViewHwnd = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, "theTreeView", WS_CHILD|WS_VISIBLE|TVS_SHOWSELALWAYS|TVS_TRACKSELECT|TVS_EDITLABELS|TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT, 0, 0, 400, myRect.bottom, hwnd, (HMENU)IDC_TREE1, hCurrentInstance, NULL);<br />
-- modified at 17:19 Wednesday 19th July, 2006
|
|
|
|
|
In that case try this
nodeSelected = (HTREEITEM)SendMessage(treeViewHwnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)nodeSelected);
AliR.
Visual C++ MVP
|
|
|
|
|
Ali unhappilly, this code doesn`t work too....
I`m almost changing to TreeView_SelectItem....
|
|
|
|
|
Hi, am new to MS VC++, and I need to interface a PC to a handeheld GPS device (Garmin etrex). Am using a serial to USB cable, and I can connect using hyperterminal so HW is ok. However, when I try to use some example code supplied on the Garmin website, I cant connect! The relevant code fragment is (I believe):
HDEVINFO theDevInfo = SetupDiGetClassDevs((GUID*) &GUID_DEVINTERFACE_GRMNUSB, NULL, NULL, DIGCF_ALLCLASSES );
SP_DEVICE_INTERFACE_DATA theInterfaceData;
theInterfaceData.cbSize = sizeof( theInterfaceData );
if( !SetupDiEnumDeviceInterfaces( theDevInfo, NULL, (GUID* &GUID_DEVINTERFACE_GRMNUSB, &theInterfaceData ) && GetLastError() == ERROR_NO_MORE_ITEMS )
{
gHandle = 0;
return;
}
--------------
Garmin tech support wont help and any help would be GREATLY appreciated
Thanks! Dinesh
|
|
|
|
|