|
Hello,
does anybody know how to convert char** to char array?
here is my code
<br />
#include stdio.h<br />
<br />
splitString(char** aString)<br />
{<br />
char[10][10] localstring;<br />
.....<br />
.....<br />
.....<br />
<br />
.....<br />
<br />
}<br />
<br />
int main<br />
{<br />
char[10][10] arraystring;<br />
splitString(arraystring);<br />
return 0;<br />
}<br />
Thanks
It is never late to learn
|
|
|
|
|
You can't!
See the Section 2.10[^].
Maxwell Chen
|
|
|
|
|
Hello,
thanks for your reply.
I think i can,
here is what i did
<br />
memcpy(localstring,aString, sizeof(localstring));<br />
But, I want localstring to point aString's address.
<br />
It is easy if<br />
char *aString, then address of aString -> &aString,<br />
if it is<br />
char **aString, then address of aString -> ??????<br />
that is the problem i dont know.
How do we get aString's address?
thanks
It is never late to learn
|
|
|
|
|
splitString(char localstring[][10])
{
.....
.....
Is it acceptable?
|
|
|
|
|
Hello,
thanks for your reply.
But it is not acceptable,
Because sometimes
i call splitString() function with char** parametr.
thanks
It is never late to learn
|
|
|
|
|
Gofur Halmurat wrote: i call splitString() function with char** parametr.
with char**, you mean simply typecast type of multidimentional array of characters or array of pointers to array. Both cannot be interchanged.
char aString[10][10] = {"Test1", "Test2", "Test3"};
char *aString2[10] = {"Test1", "Test2", "Test3"};
former uses contigious buffer while later stores pointers to some other location. So you have to be sure what kind of data the function expects.
in your example any way you can type cast like this.
char (*localString)[10][10];
localString = reinterpret_cast<char (*)[10][10]>(aString); note astring should be a multidimentional array as in your example.
if you are really expecting the muldimensional array, restrict the user by using the array in function argument.
|
|
|
|
|
Gofur Halmurat wrote: How do we get aString's address?
Its address is the same (i.e., &aString ) no matter how many * precede it. The address(es) it points to is a different matter altogether.
"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,
For my application, i used one image from a folder to display in View window.
But I can show only one image.
But if i have three bitmaps,then i have to show these three images continuosly(like slide show) while running my EXE.
Is there possible to do this?
My code is like this
bmpFilePath = gsInstallPath + "Esim\\Pic\\" + szModelName + ".bmp" ;
hBmp = (HBITMAP)::LoadImage(NULL,bmpFilePath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
Anu
|
|
|
|
|
well you can do that...this is to diaply each imag at intervel of Sleep() time...
CFileFind Finderff
if(SetCurrentDirectory("GIVE UR PATH")
{
BOOL bWorkingff = Finderff.FindFile("*.bmp");
bWorkingff = Finderff.FindNextFile();
strFileName = Finderff.GetFileName();
while(bWorkingff)
{
//open BITMAP from strFileName;
//Code to DIAPLay bitmap//
Sleep(100); //as per ur need
bWorkingff = Finderff.FindNextFile();
strFileName = Finderff.GetFileName();
}
}
Good Luck!!
|
|
|
|
|
It seems you are using MFC, CImage is easy to use.
Have a look into CImage::Load, CImage::Draw.
And May be Timer messages can be used to change the image. have look at CWnd::SetTimer() and make the view to update the new image in its paint message. For that set a flag and call CWnd::InvalidateRect or CWnd::RedrawWindow() or CDocument::UpdateAllViews in the timer handler. And in your paint handler check whether image change (check flag) and draw changed image otherwise the current image.
Always try to draw only in paint handlers.
modified on Tuesday, March 11, 2008 8:20 AM
|
|
|
|
|
Yeap ture ... Good
|
|
|
|
|
Hi,
I'm developing a tool to show several graphs. But only the users that have been succesfully authentificated by LDAP should see those graphs. I'm developing with MFC+Visual Studio 2003.
I'm not really sure how to do this. I've been reading for a while about LDAP but I'm not sure how to implement authentification by LDAP in my App.
This is just a test I have done doing copy&paste from other code, but it always returns err=0x31.
LDAP* ld = NULL;<br />
INT iRtn = 0; <br />
INT connectSuccess = 0;<br />
PCHAR pHost = NULL;<br />
PCHAR userDN = NULL;<br />
PCHAR pw = NULL;<br />
ULONG version = LDAP_VERSION3;<br />
LONG lv = 0;<br />
CString strDomain;<br />
CString strName;<br />
CString strPass;<br />
GetDlgItem(IDC_DOMAIN)->GetWindowText(strDomain);<br />
GetDlgItem(IDC_PASSWORD)->GetWindowText(strPass);<br />
GetDlgItem(IDC_NAME)->GetWindowText(strName);<br />
<br />
CString dn = "CN=" + strName +",DM=" + strDomain;<br />
<br />
ld = ldap_open(pHost,0);<br />
if (ld == NULL)<br />
GetDlgItem(IDC_EDIT4)->SetWindowText("ldap_open failed");<br />
else<br />
{<br />
GetDlgItem(IDC_EDIT4)->SetWindowText("ldap_open OK");<br />
ld->ld_lberoptions = 0;<br />
<br />
pw = new char [strPass.GetLength()+1];<br />
strcpy (pw,(LPCTSTR)strPass);<br />
<br />
userDN = new char [dn.GetLength()+1];<br />
strcpy (userDN,(LPCTSTR)dn);<br />
<br />
INT err = ldap_simple_bind_s( ld, userDN, pw );<br />
CString error;<br />
error.Format("%d", err);<br />
GetDlgItem(IDC_EDIT4)->SetWindowText("simple bind returned " + error);<br />
}<br />
<br />
<br />
<br />
<br />
if (ld != NULL)<br />
ldap_unbind_s(ld);<br />
<br />
if(pHost!=NULL)<br />
delete pHost;<br />
<br />
if(userDN != NULL)<br />
delete userDN;<br />
<br />
if(pw != NULL)<br />
delete pw;
Regards and sorry for my poor english
|
|
|
|
|
Hi all.
I am a programmer using MFC and i am supposed to make a program that is displaying details on a web page. I have not the simplest ideas where i am supposed to start. I am using visual studio 2005. Some one told me about using C# but i am not so enthusiatic about using C#. Is there a way i can still use MFC for Web Programming? Are there any good resources in the internet to do the same. Please help.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Wamuti wrote: Is there a way i can still use MFC for Web Programming?
No, that's just not possible. MFC is a framework for windows apps. You need to use a framework that generals HTML. You will find that HTML is a lot more limited compared to MFC, in terms of the freedom you have to create and interact with controls. But, you have no choice. C#/ASP.NET is your best bet.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: No, that's just not possible.
It is perfectly possible to write web applications with MFC ISAPI extensions. Whether it is the optimal approach in his case it is a different question.
|
|
|
|
|
thanks alot. I am already looking at (can't find the hash on my keyboard!!). sharp and already loving it.though funny i have to learn how to declare a variable
Oh, i love your signature!! Quite hilarious.
Christian Graus wrote: "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne
I also doubt it's a good name for a function!
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
As Christian says, .NET is your best choice for the UI in the web.
Using MFC you could create some ISAPI extensions, to interact with the data in a bussines layer.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Wamuti wrote: Is there a way i can still use MFC for Web Programming?
MFC Internet Programming[^] Most likely, you'll be interested in ISAPI extensions, since ATL Server is being deprecated.
|
|
|
|
|
Hi
DLL Loads Successfully ......Now i want to use its funtions in my program .......i need ur suggestions.....
Thanks
AbidBhat
|
|
|
|
|
Which way do you load the DLL?
Maxwell Chen
|
|
|
|
|
What about calling?
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
|
|
|
|
|
here[^]
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Always read msdn and understand API behaviours , atleast for APIs you are using. If you loaded the DLL (possibly LoadLibrary), if read the API documentation of LoadLibrary, GetProcAdress() is meantioned in its "remarks" section and also refer "see also"section and also "Example Code" section.
|
|
|
|
|
hello everyone,
good afternoon to all.i am doing smart card reading function.so in this function i have to do first connection or port setting. in this i have use middle function how can i find middle value of that port.like in VB we use like this:port=val(Mid("USB1",4))-1; similarly what function i have to use in VC++.please help me out.
its urgent please help me. and tell me VC++ reference books.
THANKU,
savitri
|
|
|
|
|
Smartcard reading doesn't use ports.
Maxwell Chen
|
|
|
|